package cn.com.qmth.stmms.biz.user.service;

import java.util.Set;

import cn.com.qmth.stmms.biz.user.model.User;
import cn.com.qmth.stmms.biz.user.service.query.UserSearchQuery;
import cn.com.qmth.stmms.common.enums.Role;

public interface UserService {

    User login(String loginName, String password, String ip);

    User externalLogin(Integer schoolId, String account, String name, String password, Role role);

    User findByLoginName(String loginName);

    User findById(Integer id);

    UserSearchQuery findByQuery(final UserSearchQuery query);

    User save(User user);

    User findSchoolAdmin(int schoolId);

    User findSchoolViewer(Integer schoolId);

    User findByMarkerId(Integer markerId);

    User externalSaveAndUpdate(Integer schoolId, String account, String name, String password, Role role);

    User findByAccount(Integer schoolId, String account);

    int batchSaveMarker(int examId, Set<String> subjectCodes, Integer number, String password, boolean random);

    int batchSaveSubjectUser(int examId, Role role, Set<String> subjectCodes, Integer number, String password,
            boolean random);

    public int findMaxNumberByLoginNameStart(String prefix);

}
