| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package com.zhiqiyun.open.router.apis;
- import com.dliyun.oap.framework.annotation.ServiceMethod;
- import com.dliyun.oap.framework.annotation.ServiceMethodBean;
- import com.dliyun.oap.framework.response.OapResponse;
- import com.zhiqiyun.open.core.enmus.ComplaintState;
- import com.zhiqiyun.open.core.models.statistics.ComplaintInfo;
- import com.zhiqiyun.open.core.service.ComplaintInfoService;
- import com.zhiqiyun.open.core.service.SequenceService;
- import com.zhiqiyun.open.router.request.SaveComplaintInfoRequest;
- import com.zhiqiyun.open.utils.DateUtil;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.BeanUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- @Slf4j
- @ServiceMethodBean
- public class ComplaintApi {
- @Autowired
- private ComplaintInfoService complaintInfoService;
- @Autowired
- private SequenceService sequenceService;
- @ServiceMethod(method = "save.complaint.info", title = "保存客诉信息")
- public OapResponse saveComplaintInfo(SaveComplaintInfoRequest request) {
- Long id = this.sequenceService.nextId();
- ComplaintInfo entity = new ComplaintInfo();
- entity.setTitle(request.getTitle());
- entity.setCategory(request.getCategory());
- entity.setChannel(request.getChannel());
- entity.setLitpics(request.getLitpics());
- entity.setContent(request.getContent());
- entity.setState(ComplaintState.PENDING);
- entity.setCreatedTime(DateUtil.current());
- entity.setId(id);
- this.complaintInfoService.save(entity);
- return OapResponse.success();
- }
- }
|