|
|
@ -5,12 +5,14 @@ package com.epmet.controller; |
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.dto.form.StaffInfoFromDTO; |
|
|
|
import com.epmet.dto.form.StaffSubmitFromDTO; |
|
|
|
import com.epmet.dto.form.StaffsInAgencyFromDTO; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.service.StaffService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
@ -81,6 +83,7 @@ public class StaffController { |
|
|
|
*/ |
|
|
|
@PostMapping("addstaff") |
|
|
|
public Result addStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitFromDTO fromDTO){ |
|
|
|
ValidatorUtils.validateEntity(fromDTO); |
|
|
|
return staffService.addStaff(tokenDto, fromDTO); |
|
|
|
} |
|
|
|
|
|
|
@ -92,6 +95,7 @@ public class StaffController { |
|
|
|
*/ |
|
|
|
@PostMapping("editstaff") |
|
|
|
public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitFromDTO fromDTO){ |
|
|
|
ValidatorUtils.validateEntity(fromDTO); |
|
|
|
return staffService.editStaff(tokenDto, fromDTO); |
|
|
|
} |
|
|
|
|
|
|
|