Commit fbe36f84 by 汪鑫

旅馆一件事

parent faa284e9
package com.ihooyah.model.controller; package com.ihooyah.model.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ihooyah.base.BaseController; import com.ihooyah.base.BaseController;
import com.ihooyah.model.mapper.RequestBodyMapper;
import com.ihooyah.model.pojo.entity.RequestBodyEntity;
import com.ihooyah.model.pojo.vo.HotelMaterialListingVO; import com.ihooyah.model.pojo.vo.HotelMaterialListingVO;
import com.ihooyah.model.pojo.vo.OrgCodeVO; import com.ihooyah.model.pojo.vo.OrgCodeVO;
import com.ihooyah.model.service.HotelMaterialListingService; import com.ihooyah.model.service.HotelMaterialListingService;
...@@ -11,10 +15,7 @@ import com.ihooyah.utils.files.FileSaveUtils; ...@@ -11,10 +15,7 @@ import com.ihooyah.utils.files.FileSaveUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Encoder; import sun.misc.BASE64Encoder;
...@@ -32,6 +33,9 @@ public class CommonController extends BaseController { ...@@ -32,6 +33,9 @@ public class CommonController extends BaseController {
@Autowired @Autowired
private HotelMaterialListingService hotelMaterialListingService; private HotelMaterialListingService hotelMaterialListingService;
@Autowired
private RequestBodyMapper requestBodyMapper;
/** /**
* 上传文件 * 上传文件
* *
...@@ -79,4 +83,13 @@ public class CommonController extends BaseController { ...@@ -79,4 +83,13 @@ public class CommonController extends BaseController {
baseStr = baseStr.replaceAll("\r", "").replaceAll("\n",""); baseStr = baseStr.replaceAll("\r", "").replaceAll("\n","");
return RespInfo.mobiSuccess((Object) baseStr); return RespInfo.mobiSuccess((Object) baseStr);
} }
@ApiOperation("保存参数")
@PostMapping("saveRequestBody")
public RespInfo<Boolean> saveRequestBody(@RequestBody RequestBodyEntity params){
params.setId(IdUtil.fastSimpleUUID());
params.setCreateTime(DateUtil.date());
requestBodyMapper.insert(params);
return RespInfo.mobiSuccess(true);
}
} }
package com.ihooyah.model.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ihooyah.model.pojo.entity.RequestBodyEntity;
import org.springframework.stereotype.Repository;
/**
* @author ***
* @version V1.0
* @Description
* @Package com.ihooyah.model.mapper
* @date 2023-07-20 10:31
*/
@Repository
public interface RequestBodyMapper extends BaseMapper<RequestBodyEntity> {
}
package com.ihooyah.model.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.util.Date;
/**
* @author ***
* @version V1.0
* @Description
* @Package com.ihooyah.model.pojo.entity
* @date 2023-07-20 10:30
*/
@Data
public class RequestBodyEntity {
@TableId
private String id;
@TableField("params")
private String params;
@TableField("create_time")
private Date createTime;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ihooyah.model.mapper.RequestBodyMapper">
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment