‘linchangsheng’ 6 kuukautta sitten
vanhempi
commit
9f5b3162b7

+ 59 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/policy/MailboxController.java

@@ -0,0 +1,59 @@
+package com.gree.mall.manager.controller.policy;
+
+import cn.hutool.core.lang.TypeReference;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.policy.AgreementAddUp;
+import com.gree.mall.manager.bean.policy.AgreementDetail;
+import com.gree.mall.manager.bean.policy.AgreementVo;
+import com.gree.mall.manager.bean.policy.PolicyVo;
+import com.gree.mall.manager.exception.RemoteServiceException;
+import com.gree.mall.manager.helper.ResponseHelper;
+import com.gree.mall.manager.logic.policy.AgreementLogic;
+import com.gree.mall.manager.plus.entity.Mailbox;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.text.ParseException;
+
+@Slf4j
+@RestController
+@Api(value = "邮箱配置", tags = {"邮箱配置"})
+@RequestMapping(value = "/mailbox", produces = "application/json; charset=utf-8")
+public class MailboxController {
+
+    @Autowired
+    private AgreementLogic agreementLogic;
+
+
+    @PostMapping("/detail")
+    @ApiOperation("邮箱配置详情")
+    public ResponseHelper<Mailbox> detail(
+            HttpServletRequest request
+    ) throws ParseException {
+        Mailbox mailbox = agreementLogic.detailMailbox();
+        return ResponseHelper.success(mailbox);
+    }
+
+    @PostMapping("/add")
+    @ApiOperation("邮箱配置修改")
+    public ResponseHelper add(
+            @RequestBody Mailbox mailbox,
+            HttpServletRequest request
+    ) throws ParseException {
+        agreementLogic.addDetail(mailbox);
+        return ResponseHelper.success();
+    }
+
+
+
+}

+ 27 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/AgreementLogic.java

@@ -12,9 +12,11 @@ import com.gree.mall.manager.commonmapper.PolicyCMapper;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.plus.entity.Agreement;
 import com.gree.mall.manager.plus.entity.AgreementPolicy;
+import com.gree.mall.manager.plus.entity.Mailbox;
 import com.gree.mall.manager.plus.entity.Policy;
 import com.gree.mall.manager.plus.service.AgreementPolicyService;
 import com.gree.mall.manager.plus.service.AgreementService;
+import com.gree.mall.manager.plus.service.MailboxService;
 import com.gree.mall.manager.plus.service.PolicyService;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
@@ -44,6 +46,10 @@ public class AgreementLogic {
     @Autowired
     PolicyService policyService;
 
+    @Autowired
+    MailboxService mailboxService;
+
+
 
     public IPage<AgreementVo> list(Page page, ZfireParamBean zfireParam) {
 
@@ -106,4 +112,25 @@ public class AgreementLogic {
         }
         agreementPolicyService.saveBatch(agreementAddUp.getAgreementPolicies());
     }
+
+    public Mailbox detailMailbox() {
+
+        if (mailboxService.lambdaQuery().eq(Mailbox::getId,"1").count() < 1)
+            return new Mailbox();
+
+
+        return mailboxService.getById("1");
+
+    }
+
+    public void addDetail(Mailbox mailbox) {
+        if (mailboxService.lambdaQuery().eq(Mailbox::getId,"1").count() < 1){
+            mailbox.setId("1");
+            mailbox.insert();
+            return;
+        }
+        mailbox.setId("1");
+        mailbox.updateById();
+
+    }
 }

+ 8 - 3
mall-server-api/src/main/resources/bootstrap-dev.properties

@@ -105,10 +105,15 @@ spring.elasticsearch.rest.read-timeout=30s
 cmc.bank.url=http://cdctest.cmburl.cn:80/cdcserver/api/v2
 
 #联通云呼配置
+#unicome.yunh.baseurl=https://a5.7x24cc.com
+#unicome.yunh.account=N000000015221
+#unicome.yunh.secret=fe443fc0264411ec80212baafe602ea7
+#unicome.yunh.appid=69jpgmwqxyhtcsor
+
 unicome.yunh.baseurl=https://a5.7x24cc.com
-unicome.yunh.account=N000000015221
-unicome.yunh.secret=fe443fc0264411ec80212baafe602ea7
-unicome.yunh.appid=69jpgmwqxyhtcsor
+unicome.yunh.account=N000000014414
+unicome.yunh.secret=c33fe780-fd69-11ea-8033-ff87e22c5f18
+unicome.yunh.appid=a6s2zu00twewmi
 
 #法大大
 fadada.app.id=401793

+ 3 - 3
mall-server-api/src/main/resources/bootstrap-prd.propertiesb

@@ -88,9 +88,9 @@ management.health.elasticsearch.enabled=false
 
 #联通云呼配置
 unicome.yunh.baseurl=https://a5.7x24cc.com
-unicome.yunh.account=N000000015221
-unicome.yunh.secret=fe443fc0264411ec80212baafe602ea7
-unicome.yunh.appid=69jpgmwqxyhtcsor
+unicome.yunh.account=N000000014414
+unicome.yunh.secret=c33fe780-fd69-11ea-8033-ff87e22c5f18
+unicome.yunh.appid=a6s2zu00twewmi
 
 #法大大
 fadada.app.id=401793

+ 8 - 3
mall-server-api/src/main/resources/bootstrap-test.properties

@@ -94,10 +94,15 @@ cmc.bank.sm4key=VuAzSWQhsoNqzn0K
 cmc.bank.uid=B000012532
 
 #联通云呼配置
+#unicome.yunh.baseurl=https://a5.7x24cc.com
+#unicome.yunh.account=N000000015221
+#unicome.yunh.secret=fe443fc0264411ec80212baafe602ea7
+#unicome.yunh.appid=69jpgmwqxyhtcsor
+
 unicome.yunh.baseurl=https://a5.7x24cc.com
-unicome.yunh.account=N000000015221
-unicome.yunh.secret=fe443fc0264411ec80212baafe602ea7
-unicome.yunh.appid=69jpgmwqxyhtcsor
+unicome.yunh.account=N000000014414
+unicome.yunh.secret=c33fe780-fd69-11ea-8033-ff87e22c5f18
+unicome.yunh.appid=a6s2zu00twewmi
 
 #法大大
 fadada.app.id=401793