Commit 24e332fa authored by 赵啸非's avatar 赵啸非

添加服务检测拉起脚本

parent 31e681d1
......@@ -24,17 +24,7 @@ import java.util.List;
public class BizLogServiceImpl extends AbstractCRUDServiceImpl<BizLogDao, BizLogEntity, Long> implements BizLogService {
@Override
public BizLogEntity save(BizLogEntity entity, Context context) throws AppException {
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
return super.save(entity, context);
}
// @Override
// public int save(List<BizLogEntity> list, Context context) throws AppException {
// list.forEach(item->item.setId(IdUtil.getSnowflake(0, 1).nextId()));
// return super.save(list, context);
// }
@Override
public BizLogEntity get(Long key, Context context) throws AppException {
......
package com.mortals.xhx.module.biz.web;
import cn.hutool.core.util.IdUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
......@@ -56,6 +57,10 @@ public class BizLogController extends BaseCRUDJsonBodyMappingController<BizLogSe
@Override
@UnAuth
public String save(@RequestBody BizLogEntity entity) {
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
entity.setCreateUserId(1L);
entity.setCreateUserName("system");
entity.setCreateTime(new Date());
return super.save(entity);
}
}
\ No newline at end of file
......@@ -25,13 +25,6 @@ import java.util.List;
*/
@Service("errorLogService")
public class ErrorLogServiceImpl extends AbstractCRUDServiceImpl<ErrorLogDao, ErrorLogEntity, Long> implements ErrorLogService {
@Override
protected void saveBefore(ErrorLogEntity entity, Context context) throws AppException {
//判断当前是否有重复的
//非系统自增,需这里设置主键
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
super.saveBefore(entity, context);
}
@Override
public int save(List<ErrorLogEntity> list, Context context) throws AppException {
......
package com.mortals.xhx.module.error.web;
import cn.hutool.core.util.IdUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
......@@ -59,6 +60,10 @@ public class ErrorLogController extends BaseCRUDJsonBodyMappingController<ErrorL
@Override
@UnAuth
public String save(@RequestBody ErrorLogEntity entity) {
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
entity.setCreateUserId(1L);
entity.setCreateUserName("system");
entity.setCreateTime(new Date());
return super.save(entity);
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.operate.dao.OperateLogDao;
import com.mortals.xhx.module.operate.model.OperateLogEntity;
import com.mortals.xhx.module.operate.service.OperateLogService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
......@@ -24,18 +25,6 @@ import java.util.List;
@Service("operateLogService")
public class OperateLogServiceImpl extends AbstractCRUDServiceImpl<OperateLogDao, OperateLogEntity, Long> implements OperateLogService {
@Override
public OperateLogEntity save(OperateLogEntity entity) throws AppException {
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
return super.save(entity);
}
@Override
public OperateLogEntity save(OperateLogEntity entity, Context context) throws AppException {
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
return super.save(entity, context);
}
@Override
public int save(List<OperateLogEntity> list, Context context) throws AppException {
list.forEach(item -> item.setId(IdUtil.getSnowflake(0, 1).nextId()));
......
package com.mortals.xhx.module.operate.web;
import cn.hutool.core.util.IdUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
......@@ -58,7 +60,10 @@ public class OperateLogController extends BaseCRUDJsonBodyMappingController<Oper
@Override
@UnAuth
public String save(@RequestBody OperateLogEntity entity) {
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
entity.setCreateUserId(1L);
entity.setCreateUserName("system");
entity.setCreateTime(new Date());
return super.save(entity);
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ Content-Type: application/json
"content":"5x7eyb",
"ip":"h6wkk2",
"logDate":"2023-05-01 16:25:12",
"operType":574
"operType":"1"
}
> {%
......
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