Commit 3d21119a by 吴迪

【新增】新增 codeeagent表清洗代码

parent 247011f5
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.CodeagentEntity;
import io.office.modules.manage.service.CodeagentService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2022-01-09 10:19:30
*/
@RestController
@RequestMapping("/codeagent")
public class CodeagentController {
@Autowired
private CodeagentService codeagentService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:codeagent:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = codeagentService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:codeagent:info")
public R info(@PathVariable("id") Integer id){
CodeagentEntity codeagent = codeagentService.getById(id);
return R.ok().put("codeagent", codeagent);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:codeagent:save")
public R save(@RequestBody CodeagentEntity codeagent){
codeagentService.save(codeagent);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:codeagent:update")
public R update(@RequestBody CodeagentEntity codeagent){
codeagentService.updateById(codeagent);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:codeagent:delete")
public R delete(@RequestBody Integer[] ids){
codeagentService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.CodeagentEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2022-01-09 10:19:30
*/
@Mapper
public interface CodeagentDao extends BaseMapper<CodeagentEntity> {
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2022-01-09 10:19:30
*/
@Data
@TableName("CodeAgent")
public class CodeagentEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer id;
/**
* $column.comments
*/
private String title;
/**
* $column.comments
*/
private String content;
/**
* $column.comments
*/
private String address;
/**
* $column.comments
*/
private String phone;
/**
* $column.comments
*/
private String postcode;
/**
* $column.comments
*/
private String contactman;
/**
* $column.comments
*/
private String fax;
/**
* $column.comments
*/
private String description;
/**
* $column.comments
*/
private String mail;
/**
* $column.comments
*/
private String website;
/**
* $column.comments
*/
private String addressDescription;
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.CodeagentEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2022-01-09 10:19:30
*/
public interface CodeagentService extends IService<CodeagentEntity> {
PageUtils queryPage(Map<String, Object> params);
}
package io.office.modules.manage.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.CodeagentDao;
import io.office.modules.manage.entity.CodeagentEntity;
import io.office.modules.manage.service.CodeagentService;
@Service("codeagentService")
public class CodeagentServiceImpl extends ServiceImpl<CodeagentDao, CodeagentEntity> implements CodeagentService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<CodeagentEntity> page = this.page(
new Query<CodeagentEntity>().getPage(params),
new QueryWrapper<CodeagentEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ spring:
name: GS1OfficeWebSit
# 环境 dev|test|prod
profiles:
active: test
active: dev
# jackson时间格式化
jackson:
time-zone: GMT+8
......
<?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="io.office.modules.manage.dao.CodeagentDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.CodeagentEntity" id="codeagentMap">
<result property="id" column="Id"/>
<result property="title" column="Title"/>
<result property="content" column="content"/>
<result property="address" column="Address"/>
<result property="phone" column="Phone"/>
<result property="postcode" column="Postcode"/>
<result property="contactman" column="contactman"/>
<result property="fax" column="fax"/>
<result property="description" column="description"/>
<result property="mail" column="mail"/>
<result property="website" column="website"/>
<result property="addressDescription" column="address_description"/>
</resultMap>
</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