wangning 6 years ago
parent 6728986797
commit 10b60ec4a3

@ -558,3 +558,11 @@ alter table sys_client_pre_apply add column `password_hash` varchar(150) NOT NUL
alter table sys_client_pre_apply add column `password_aes` varchar(50) NOT NULL COMMENT '登录账户密码 AES加密';
alter table sys_client_pre_apply add column apply_source varchar(10) default null COMMENT '申请渠道';
create table sys_mail_sub(
mail_address varchar(50) not null,
client_id int(11) NOT NULL,
client_moniker varchar(20) NOT NULL,
create_time TIMESTAMP not null DEFAULT now()
);

@ -0,0 +1,26 @@
package au.com.royalpay.payment.manage.mappers.system;
import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/**
* Created by davep on 2016-08-03.
*/
@AutoMapper(tablename = "sys_mail_unsub", pkName = "id")
public interface MailUnsubMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject record);
@AutoSql(type = SqlType.DELETE)
void delete(@Param("id") Long id);
@AutoSql(type = SqlType.SELECT)
JSONObject getById(@Param("id") Long id);
}

@ -18,4 +18,8 @@ public interface MailService {
String sendEmail(String title, String mailTos, String mailCcs, String content, List<JSONObject> attachFiles) throws URISyntaxException, IOException;
List<JSONObject> checkEmailStatus(String emailId);
void removeUnsub(Long id);
void addUnsub(int clientId);
}

@ -1,8 +1,12 @@
package au.com.royalpay.payment.manage.notice.core.impls;
import au.com.royalpay.payment.manage.mappers.system.MailUnsubMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.beans.NoticeBean;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@ -25,6 +29,8 @@ import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
@ -40,6 +46,10 @@ public class MailServiceImp implements MailService {
private String mailHost;
@Value("${mail.send.credentialCode}")
private String credentialCode;
@Resource
private MailUnsubMapper mailUnsubMapper;
@Resource
private ClientManager clientManager;
/* @Override
public void sendEmail(NoticeBean noticeBean) {
@ -174,6 +184,29 @@ public class MailServiceImp implements MailService {
}
@Override
public void removeUnsub(Long id) {
JSONObject record = mailUnsubMapper.getById(id);
if(record == null){
return;
}
mailUnsubMapper.delete(id);
}
@Override
public void addUnsub(int clientId) {
JSONObject client = clientManager.getClientInfo(clientId);
if(client==null){
throw new NotFoundException("Merchant not Found");
}
JSONObject record= new JSONObject();
record.put("id", IdUtil.getId());
record.put("address",client.getString("contact_mail"));
record.put("client_id",client.getIntValue("client_id"));
record.put("client_moniker",client.getString("client_moniker"));
mailUnsubMapper.save(record);
}
@Override
public String sendEmail(String title, String mailTos, String mailCcs, String content, List<JSONObject> attachFiles) throws URISyntaxException, IOException {
NoticeBean noticeBean = new NoticeBean();

@ -0,0 +1,26 @@
package au.com.royalpay.payment.manage.system.web;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @author kira
* @date 2018/6/12
*/
@RestController
@RequestMapping("/sys/mail")
public class MailController {
@RequestMapping(value = "/sub/{id}",method = RequestMethod.DELETE)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public void removeSub(@PathVariable Long id) {
// return clientApply.listPartnerApply(manager,apply);
}
}

@ -1,6 +1,6 @@
server.port=5000
spring.profiles.active=dev,alipay,bestpay,jd,wechat
spring.profiles.active=proxy,alipay,bestpay,jd,wechat
env.company=RoyalPay
@ -18,11 +18,11 @@ spring.datasource.max-idle=150
spring.datasource.max-wait=3000
spring.datasource.filters=stat,wall,log4j
spring.redis.host=127.0.0.1
spring.redis.host=192.168.99.100
spring.redis.port=6379
spring.redis.database=1
spring.data.mongodb.host=10.30.0.8
spring.data.mongodb.host=192.168.99.100
spring.data.mongodb.port=27017
spring.data.mongodb.database=admin
spring.data.mongodb.username=mongouser

Loading…
Cancel
Save