Commit 3bb0f553 by songyinghui

feat: 操作日志模块对应

parent e71f7f80
......@@ -5,10 +5,8 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.hm.HmWelcomeRelationDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.FriendSettingDetailDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeDetailDTO;
......@@ -25,10 +23,14 @@ import com.gic.haoban.manage.api.enums.hm.HmWelcomeType;
import com.gic.haoban.manage.api.service.hm.HmWelcomeRelationApiService;
import com.gic.haoban.manage.api.service.out.WelcomeApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.log.LogRecordUserServiceImpl;
import com.gic.haoban.manage.web.qo.welcome.ListWelcomeQO;
import com.gic.haoban.manage.web.qo.welcome.SaveFriendSettingQO;
import com.gic.haoban.manage.web.qo.welcome.SaveWelcomeQO;
import com.gic.log.record.anno.GicLogRecord;
import com.gic.log.record.util.GicLogRecordCategoryEnum;
import com.gic.log.record.util.GicLogRecordEvaluationContext;
import com.gic.log.record.util.GicLogRecordOptTypeEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -80,6 +82,8 @@ public class WelcomeController extends WebBaseController {
* @author : YongEn
* @date : 2022/2/11
*/
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.WELCOME_ADD
,optPage = "引流链接-落地页模板", userFunc = LogRecordUserServiceImpl.class )
@RequestMapping(value = "/save", method = RequestMethod.POST)
public RestResponse<Boolean> saveWelcome(@RequestBody @Valid SaveWelcomeQO qo) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
......@@ -113,8 +117,11 @@ public class WelcomeController extends WebBaseController {
logContent = this.buildEditWelcomeOpLog(welcomeDetail, qdto);
}
}
GicLogRecordEvaluationContext.putAttribute("name", logContent);
GicLogRecordEvaluationContext.putAttribute("logContent", logContent);
ServiceResponse<Boolean> response = welcomeApiService.saveWelcome(qdto);
if (response.isSuccess()){
GicLogRecordEvaluationContext.noWriteLog();
}
return RestResponse.successResult(response.getResult());
}
......@@ -152,14 +159,25 @@ public class WelcomeController extends WebBaseController {
* @author : YongEn
* @date : 2022/2/11
*/
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.WELCOM_DEL
,optPage = "引流链接-落地页模板", userFunc = LogRecordUserServiceImpl.class )
@RequestMapping(value = "/remove")
public RestResponse<Boolean> removeWelcome(@RequestParam("welcomeId") String welcomeId) {
public RestResponse<?> removeWelcome(@RequestParam("welcomeId") String welcomeId) {
if (StringUtils.isEmpty(welcomeId)) {
RestResponse.failure(Constant.STRING_1, "欢迎语id为空", Boolean.FALSE);
return RestResponse.failure(Constant.STRING_1, "欢迎语id为空", Boolean.FALSE);
}
String logContent = "删除新增特殊欢迎语";
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
ServiceResponse<WelcomeDetailDTO> serviceWelcome = welcomeApiService.getWelcome(welcomeId, loginUser.getEnterpriseId());
if (serviceWelcome.isSuccess() && serviceWelcome.getResult() != null){
String title = serviceWelcome.getResult().getTitle();
logContent = logContent + "【" + title + "】";
}
GicLogRecordEvaluationContext.putAttribute("logContent", logContent);
ServiceResponse<WelcomeRemoveCheckDTO> serviceResponse = welcomeApiService.removeWelcomeWithErrorInfo(welcomeId);
if (serviceResponse.getResult() != null) {
// can't remove
GicLogRecordEvaluationContext.noWriteLog();
return RestResponse.failure(HaoBanErrCode.ERR_9.getCode() + "", this.buildErrorMessage(serviceResponse.getResult()));
}
return RestResponse.successResult();
......
......@@ -38,7 +38,7 @@ public class HmGroupController extends WebBaseController {
@Autowired
private HmGroupApiService groupApiService;
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.TEST_OPT
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.HUOMA_GROUP_ADD
,optPage = "员工活码", userFunc = LogRecordUserServiceImpl.class )
@RequestMapping(path = "/save", method = RequestMethod.POST)
public RestResponse<?> saveHmGroupSetting(@Valid HmGroupSettingVO hmGroupSettingVO){
......@@ -74,7 +74,7 @@ public class HmGroupController extends WebBaseController {
return RestResponse.successResult(serviceResponse.getResult());
}
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.TEST_OPT
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.HUOMA_GROUP_UPDATE
,optPage = "员工活码", userFunc = LogRecordUserServiceImpl.class )
@RequestMapping(path = "/edit", method = RequestMethod.POST)
public RestResponse<?> editHmGroupSetting(@Valid HmGroupSettingVO hmGroupSettingVO){
......@@ -100,7 +100,7 @@ public class HmGroupController extends WebBaseController {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.TEST_OPT
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.HUOMA_GROUP_DEL
,optPage = "员工活码", userFunc = LogRecordUserServiceImpl.class )
@RequestMapping(path = "/delete", method = RequestMethod.POST)
public RestResponse<?> deleteHmGroupSetting(HmGroupSettingVO hmGroupSettingVO){
......
......@@ -41,7 +41,7 @@ public class HmPageController {
@Autowired
private HmPageApiService pageApiService;
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.TEST_OPT
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.HUOMA_PAGE_ADD
,optPage = "引流链接-落地页模板-新建模板", userFunc = LogRecordUserServiceImpl.class )
@RequestMapping(path = "/page/save")
public RestResponse<?> savePage(@Valid HmPageSettingReq pageSettingReq){
......@@ -69,7 +69,7 @@ public class HmPageController {
}
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.TEST_OPT
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.HUOMA_PAGE_UPDATE
,optPage = "引流链接-落地页模板-编辑模板", userFunc = LogRecordUserServiceImpl.class )
@RequestMapping(path = "/page/edit")
public RestResponse<?> editPage(@Valid HmPageSettingReq pageSettingReq){
......@@ -161,7 +161,7 @@ public class HmPageController {
return RestResponse.successResult(serviceResponse.getResult());
}
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.TEST_OPT
@GicLogRecord(value = "${#logContent}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.HUOMA_PAGE_DEL
,optPage = "引流链接-落地页模板", userFunc = LogRecordUserServiceImpl.class )
@RequestMapping(path = "/page/delete")
public RestResponse<?> deletePage(Long pageId){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment