parent
21ced08f55
commit
e403fd54d6
@ -0,0 +1,81 @@
|
||||
package au.com.royalpay.payment.manage.customers.beans;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class CustomerComment {
|
||||
|
||||
@NotEmpty(message = "error.payment.valid.param_missing")
|
||||
@JSONField(name = "first_name")
|
||||
private String firstName;
|
||||
|
||||
@NotEmpty(message = "error.payment.valid.param_missing")
|
||||
@JSONField(name = "last_name")
|
||||
private String lastName;
|
||||
|
||||
@NotEmpty(message = "error.payment.valid.param_missing")
|
||||
private String email;
|
||||
|
||||
private String comment;
|
||||
|
||||
@JSONField(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
private int status;
|
||||
|
||||
public JSONObject insertObject() {
|
||||
return (JSONObject) JSON.toJSON(this);
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package au.com.royalpay.payment.manage.customers.core;
|
||||
|
||||
import au.com.royalpay.payment.manage.customers.beans.CustomerComment;
|
||||
|
||||
public interface CustomerCommentService {
|
||||
|
||||
void save(CustomerComment customerComment);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package au.com.royalpay.payment.manage.customers.core.impls;
|
||||
|
||||
import au.com.royalpay.payment.manage.customers.beans.CustomerComment;
|
||||
import au.com.royalpay.payment.manage.customers.core.CustomerCommentService;
|
||||
import au.com.royalpay.payment.manage.mappers.system.SysCustomerCommentMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
public class CustomerCommentServiceImpl implements CustomerCommentService {
|
||||
|
||||
@Resource
|
||||
private SysCustomerCommentMapper customerCommentMapper;
|
||||
|
||||
@Override
|
||||
public void save(CustomerComment customerComment) {
|
||||
customerComment.setCreateTime(new Date());
|
||||
customerCommentMapper.save(customerComment.insertObject());
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package au.com.royalpay.payment.manage.customers.web;
|
||||
|
||||
import au.com.royalpay.payment.manage.customers.beans.CustomerComment;
|
||||
import au.com.royalpay.payment.manage.customers.core.CustomerCommentService;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 客户联系
|
||||
*/
|
||||
@RequestMapping("/customer")
|
||||
@RestController
|
||||
public class CustomerCommentController {
|
||||
|
||||
@Resource
|
||||
private CustomerCommentService customerCommentService;
|
||||
|
||||
@RequestMapping("/contact/comment")
|
||||
public void saveCustomerComment(@RequestBody @Valid CustomerComment customerComment) {
|
||||
customerCommentService.save(customerComment);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package au.com.royalpay.payment.manage.mappers.system;
|
||||
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
@AutoMapper(tablename = "sys_customer_comment", pkName = "id")
|
||||
public interface SysCustomerCommentMapper {
|
||||
|
||||
@AutoSql(type = SqlType.INSERT)
|
||||
void save(JSONObject info);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package au.com.royalpay.payment.manage.mappers.system;
|
||||
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@AutoMapper(tablename = "sys_customer_subscribe", pkName = "id")
|
||||
public interface SysCustomerSubscribeMapper {
|
||||
|
||||
@AutoSql(type = SqlType.INSERT)
|
||||
void save(JSONObject info);
|
||||
|
||||
@AutoSql(type = SqlType.SELECT)
|
||||
JSONObject findByEmail(@Param("subscribe_email") String email);
|
||||
|
||||
@AutoSql(type = SqlType.UPDATE)
|
||||
void update(JSONObject subscribeInfo);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
|
||||
<body>
|
||||
<div style="text-align: center">
|
||||
<img style="width: 50%" th:src="${imageUrl}" />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 348 KiB |
After Width: | Height: | Size: 326 KiB |
Loading…
Reference in new issue