员工账号接口实现
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
package com.czg.account.dto.staff;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class ShopStaffAddDTO {
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@NotNull(message = "角色id不为空")
|
||||
private Long roleId;
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 登录账号
|
||||
*/
|
||||
@NotEmpty(message = "登录账号不为空")
|
||||
private String accountName;
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
@NotEmpty(message = "登录密码不为空")
|
||||
private String accountPwd;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotEmpty(message = "手机号不为空")
|
||||
private String phone;
|
||||
/**
|
||||
* 员工编号
|
||||
*/
|
||||
@NotEmpty(message = "员工编号不为空")
|
||||
private String code;
|
||||
/**
|
||||
* 优惠类型 1 折扣 0 金额
|
||||
*/
|
||||
private Integer discountType = 1;
|
||||
/**
|
||||
* 最大优惠金额
|
||||
*/
|
||||
private BigDecimal maxDiscountAmount;
|
||||
/**
|
||||
* 1启用0不启用
|
||||
*/
|
||||
private Integer status = 1;
|
||||
/**
|
||||
* 是否允许管理端登录
|
||||
*/
|
||||
private Integer isManage = 1;
|
||||
/**
|
||||
* 是否允许pc登录
|
||||
*/
|
||||
private Integer isPc = 1;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.czg.account.dto.staff;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class ShopStaffEditDTO {
|
||||
@NotNull(message = "id不为空")
|
||||
private Long id;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
private String accountPwd;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 员工编号
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 优惠类型 1 折扣 0 金额
|
||||
*/
|
||||
private Integer discountType;
|
||||
/**
|
||||
* 最大优惠金额
|
||||
*/
|
||||
private BigDecimal maxDiscountAmount;
|
||||
/**
|
||||
* 1启用0不启用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 是否允许管理端登录
|
||||
*/
|
||||
private Integer isManage;
|
||||
/**
|
||||
* 是否允许pc登录
|
||||
*/
|
||||
private Integer isPc;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.czg.account.dto.staff;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class ShopStaffRemoveDTO {
|
||||
@NotNull(message = "id不为空")
|
||||
private Long id;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class ShopStaff implements Serializable {
|
||||
/**
|
||||
* shopId
|
||||
*/
|
||||
private String shopId;
|
||||
private Long shopId;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@@ -4,5 +4,19 @@ package com.czg.account.service;
|
||||
* @author Administrator
|
||||
*/
|
||||
public interface CommonService {
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param type 验证码类型
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean sendSms(String type);
|
||||
|
||||
/**
|
||||
* 校验短信验证码是否正常
|
||||
* @param type 验证码类型
|
||||
* @param code 验证码
|
||||
* @return 是否正确
|
||||
*/
|
||||
Boolean checkSmsCode(String type, String code);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.staff.ShopStaffAddDTO;
|
||||
import com.czg.account.dto.staff.ShopStaffEditDTO;
|
||||
import com.czg.account.dto.staff.ShopStaffRemoveDTO;
|
||||
import com.czg.account.entity.ShopStaff;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
/**
|
||||
@@ -11,4 +15,11 @@ import com.mybatisflex.core.service.IService;
|
||||
*/
|
||||
public interface ShopStaffService extends IService<ShopStaff> {
|
||||
|
||||
Boolean add(ShopStaffAddDTO shopStaffAddDTO);
|
||||
|
||||
Boolean edit(ShopStaffEditDTO shopStaffEditDTO);
|
||||
|
||||
Page<ShopStaff> get(String name, String code);
|
||||
|
||||
Boolean delete(ShopStaffRemoveDTO shopStaffRemoveDTO);
|
||||
}
|
||||
|
||||
@@ -11,4 +11,9 @@ import com.mybatisflex.core.service.IService;
|
||||
*/
|
||||
public interface SysUserService extends IService<SysUser> {
|
||||
|
||||
SysUser addUser(String nickname, String accountName, String accountPwd, String phone, Long roleId);
|
||||
|
||||
Boolean updateSysUserPwd(long sysUserId, String accountPwd);
|
||||
|
||||
Boolean removeUserAndRole(Integer id);
|
||||
}
|
||||
|
||||
@@ -11,4 +11,5 @@ import com.mybatisflex.core.service.IService;
|
||||
*/
|
||||
public interface SysUsersRolesService extends IService<SysUsersRoles> {
|
||||
|
||||
Boolean updateRole(long sysUserId, Long roleId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user