lyhzzz 5 giorni fa
parent
commit
fd0b655c1e

+ 1 - 2
src/main/java/com/fdkankan/ucenter/controller/ContactUsController.java

@@ -40,8 +40,7 @@ public class ContactUsController extends BaseController {
         String ip = IPUtils.getIpAddr(request);
         contactUs.setIpAddress(ip);
         contactUs.setSessionId(request.getSession().getId());
-        contactUsService.submit(contactUs);
-        return Result.success();
+        return Result.success(contactUsService.submit(contactUs));
     }
 
     @GetMapping("/callBack/{uuid}")

+ 2 - 1
src/main/java/com/fdkankan/ucenter/service/IContactUsService.java

@@ -3,6 +3,7 @@ package com.fdkankan.ucenter.service;
 import com.fdkankan.ucenter.entity.ContactUs;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.ucenter.entity.ContactUsPoint;
+import com.fdkankan.ucenter.vo.response.ContactUsSubmitVo;
 import com.fdkankan.ucenter.vo.response.LoginVo;
 import com.fdkankan.ucenter.vo.response.SceneVo;
 import org.springframework.http.ResponseEntity;
@@ -21,7 +22,7 @@ import java.util.Map;
  */
 public interface IContactUsService extends IService<ContactUs> {
 
-    void submit(ContactUs contactUs);
+    ContactUsSubmitVo submit(ContactUs contactUs);
 
     LoginVo callBack(String email);
 

+ 4 - 6
src/main/java/com/fdkankan/ucenter/service/impl/ContactUsServiceImpl.java

@@ -16,10 +16,7 @@ import com.fdkankan.ucenter.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.ucenter.util.DateUserUtil;
 import com.fdkankan.ucenter.vo.request.RegisterParam;
-import com.fdkankan.ucenter.vo.response.LoginVo;
-import com.fdkankan.ucenter.vo.response.SceneInfoVo;
-import com.fdkankan.ucenter.vo.response.ScenePlusVo;
-import com.fdkankan.ucenter.vo.response.SceneVo;
+import com.fdkankan.ucenter.vo.response.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,7 +54,7 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
     UcenterConfig ucenterConfig;
 
     @Override
-    public void submit(ContactUs contactUs) {
+    public ContactUsSubmitVo submit(ContactUs contactUs) {
         if(StringUtils.isBlank(contactUs.getName()) || StringUtils.isBlank(contactUs.getTel())
                 || StringUtils.isBlank(contactUs.getEmail()) || StringUtils.isBlank(contactUs.getCompany())){
             throw new BusinessException(ResultCode.PARAM_MISS);
@@ -75,7 +72,7 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
         if(user !=null){
             mailTemplateService.sendContactUs2(contactUs.getEmail(),13);
             this.save(contactUs);
-            return;
+            return new ContactUsSubmitVo(1);
         }
 
         String callBackUrl = ucenterConfig.getContactUsCallBackUrl() + uuid;
@@ -84,6 +81,7 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
             redisUtil.set(redisKey2, JSONObject.toJSONString(contactUs),ucenterConfig.getEmailExTime());
         }
         this.save(contactUs);
+        return new ContactUsSubmitVo(0);
     }
 
     @Override

+ 10 - 0
src/main/java/com/fdkankan/ucenter/vo/response/ContactUsSubmitVo.java

@@ -0,0 +1,10 @@
+package com.fdkankan.ucenter.vo.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+@Data
+@AllArgsConstructor
+public class ContactUsSubmitVo {
+    private Integer isRegistry ;
+}