package com.mortals.xhx.module.workman.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.workman.model.WorkmanEntity;
import com.mortals.xhx.module.workman.dao.WorkmanDao;
/**
* WorkmanService
*
* 工作人员 service接口
*
* @author zxfei
* @date 2023-05-22
*/
public interface WorkmanService extends ICRUDService<WorkmanEntity,Long>{

    WorkmanDao getDao();


    /**
     * 工作人员登录
     *
     * @param loginName 登录用户名
     * @param password  登录密码
     * @param ip        ip地址
     * @return
     * @throws AppException
     */
    WorkmanEntity doLogin(String loginName, String password, String ip) throws AppException;


    /**
     * 用户修改密码
     *
     * @param loginName
     * @param oldPwd
     * @param newPwd
     * @return
     * @throws AppException
     */
    boolean updateUserPwd(String loginName, String oldPwd, String newPwd) throws AppException;

    boolean updateUserPwd(String loginName, String newPwd) throws AppException;

    Rest<String> changeStatus(WorkmanEntity workmanEntity, Context context);

}