【新增】咨询接口

This commit is contained in:
2025-11-17 15:08:52 +08:00
parent 7bd3d54d97
commit 03c5226a6a
5 changed files with 106 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
package com.corewing.app.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.corewing.app.common.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.Id;
/**
* 联系消息
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("app_contact_msg")
public class ContactMsg extends BaseEntity {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 咨询人
*/
private String name;
/**
* 咨询类型
*/
private int category;
/**
* 联系方式
*/
private String contact;
/**
* 咨询内容
*/
private String msg;
/**
* 咨询状态
*/
private int status;
}

View File

@@ -0,0 +1,10 @@
package com.corewing.app.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.corewing.app.entity.ContactMsg;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ContactMsgMapper extends BaseMapper<ContactMsg> {
}

View File

@@ -0,0 +1,25 @@
package com.corewing.app.modules.app;
import com.corewing.app.common.Result;
import com.corewing.app.entity.ContactMsg;
import com.corewing.app.service.ContactMsgService;
import org.springframework.web.bind.annotation.PostMapping;
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;
@RestController
@RequestMapping("/contactMsg")
public class AppContactMsgController {
@Resource
private ContactMsgService contactMsgService;
@PostMapping("/save")
public Result<String> save(@RequestBody ContactMsg contactMsg) {
return Result.isBool(contactMsgService.save(contactMsg));
}
}

View File

@@ -0,0 +1,7 @@
package com.corewing.app.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.corewing.app.entity.ContactMsg;
public interface ContactMsgService extends IService<ContactMsg> {
}

View File

@@ -0,0 +1,12 @@
package com.corewing.app.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.corewing.app.entity.ContactMsg;
import com.corewing.app.mapper.ContactMsgMapper;
import com.corewing.app.service.ContactMsgService;
import org.springframework.stereotype.Service;
@Service
public class ContactMsgServiceImpl extends ServiceImpl<ContactMsgMapper, ContactMsg> implements ContactMsgService {
}