master
parent
2758b49a1b
commit
e2864331e8
|
@ -1,4 +1,6 @@
|
|||
package com.bwie.common.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -17,7 +19,9 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@TableName("askbuy")
|
||||
public class AskBuy {
|
||||
@TableId
|
||||
private BigInteger askBuyId; //求租ID
|
||||
private String askBuyAddress; //求租具体地址
|
||||
private String askBuyTitle; //求租标签
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
package com.bwie.common.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -15,7 +17,9 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@TableName("askrent")
|
||||
public class AskRent {
|
||||
@TableId
|
||||
private BigInteger askRentId; //求租ID
|
||||
private String askRentAddress; //求租具体地址
|
||||
private String askRentTitle; //求租标签
|
||||
|
|
|
@ -9,6 +9,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package com.bwie.background;
|
||||
package com.bwie.ask;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@MapperScan("com.bwie.group.mapper")
|
||||
@MapperScan("com.bwie.ask.mapper")
|
||||
public class AskMapperApp {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AskMapperApp.class);
|
|
@ -0,0 +1,36 @@
|
|||
package com.bwie.ask.controller;
|
||||
|
||||
import com.bwie.ask.seriver.AskBuyService;
|
||||
import com.bwie.common.domain.AskBuy;
|
||||
import com.bwie.common.result.Result;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* 求购controller层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/buy")
|
||||
public class AskBuyController {
|
||||
|
||||
private final AskBuyService askBuyService;
|
||||
|
||||
public AskBuyController(AskBuyService askBuyService) {
|
||||
this.askBuyService = askBuyService;
|
||||
}
|
||||
|
||||
@PostMapping("/shouAll")
|
||||
public Result<List<AskBuy>> shouAll(){
|
||||
return askBuyService.shouAll();
|
||||
}
|
||||
|
||||
@PostMapping("/addAskBuy")
|
||||
public Result addAskBuy(@RequestBody AskBuy askBuy){
|
||||
return askBuyService.addAskBuy(askBuy);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.bwie.ask.controller;
|
||||
|
||||
import com.bwie.ask.seriver.AskRentService;
|
||||
import com.bwie.common.domain.AskRent;
|
||||
import com.bwie.common.result.Result;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* 求租controller层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rent")
|
||||
public class AskRentController {
|
||||
|
||||
private final AskRentService askRentService;
|
||||
|
||||
public AskRentController(AskRentService askRentService) {
|
||||
this.askRentService = askRentService;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/shouList")
|
||||
public Result<List<AskRent>> shouList(){
|
||||
return askRentService.shouList();
|
||||
}
|
||||
@PostMapping("/addAskRent")
|
||||
public Result addAskRent(@RequestBody AskRent askRent){
|
||||
return askRentService.addAskRent(askRent);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
package com.bwie.background.mapper;
|
||||
package com.bwie.ask.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bwie.common.domain.AskBuy;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 求购mapper层
|
||||
*/
|
||||
|
@ -11,4 +13,10 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
public interface AskBuyMapper extends BaseMapper<AskBuy> {
|
||||
|
||||
|
||||
List<AskBuy> shouAll();
|
||||
|
||||
|
||||
Integer addAskBuy(AskBuy askBuy);
|
||||
|
||||
|
||||
}
|
|
@ -1,12 +1,18 @@
|
|||
package com.bwie.background.mapper;
|
||||
package com.bwie.ask.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bwie.common.domain.AskRent;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 求租mapper层
|
||||
*/
|
||||
@Mapper
|
||||
public interface AskRentMapper extends BaseMapper<AskRent> {
|
||||
List<AskRent> shouList();
|
||||
|
||||
Integer addAskRent(AskRent askRent);
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.bwie.ask.seriver;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bwie.common.domain.AskBuy;
|
||||
import com.bwie.common.result.Result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AskBuyService extends IService<AskBuy> {
|
||||
|
||||
|
||||
public Result<List<AskBuy>> shouAll();
|
||||
|
||||
public Result addAskBuy(AskBuy askBuy);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.bwie.ask.seriver;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bwie.common.domain.AskRent;
|
||||
import com.bwie.common.result.Result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AskRentService extends IService<AskRent> {
|
||||
|
||||
public Result<List<AskRent>> shouList();
|
||||
|
||||
public Result addAskRent(AskRent askRent);
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.bwie.ask.seriver.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.ask.mapper.AskBuyMapper;
|
||||
import com.bwie.ask.seriver.AskBuyService;
|
||||
import com.bwie.common.domain.AskBuy;
|
||||
import com.bwie.common.result.Result;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 求购
|
||||
*/
|
||||
@Service
|
||||
public class AskBuyServiceImpl extends ServiceImpl<AskBuyMapper, AskBuy> implements AskBuyService {
|
||||
|
||||
|
||||
private final AskBuyMapper askBuyMapper;
|
||||
|
||||
|
||||
public AskBuyServiceImpl(AskBuyMapper askBuyMapper) {
|
||||
this.askBuyMapper = askBuyMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 求购的普通链表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<List<AskBuy>> shouAll(){
|
||||
List<AskBuy> askBuys = askBuyMapper.shouAll();
|
||||
return Result.success(askBuys);
|
||||
}
|
||||
@Override
|
||||
public Result addAskBuy(AskBuy askBuy){
|
||||
Integer i = askBuyMapper.addAskBuy(askBuy);
|
||||
return Result.success(i>0?200:500,i>0?"发表成功!!!!":"发表失败!!!!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.bwie.ask.seriver.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.ask.mapper.AskRentMapper;
|
||||
import com.bwie.ask.seriver.AskRentService;
|
||||
import com.bwie.common.domain.AskRent;
|
||||
import com.bwie.common.result.Result;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 求租
|
||||
*/
|
||||
@Service
|
||||
public class AskRentServiceImpl extends ServiceImpl<AskRentMapper, AskRent> implements AskRentService {
|
||||
|
||||
private final AskRentMapper askRentMapper;
|
||||
|
||||
public AskRentServiceImpl(AskRentMapper askRentMapper) {
|
||||
this.askRentMapper = askRentMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 求租的普通链表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<List<AskRent>> shouList(){
|
||||
List<AskRent> askRentList = askRentMapper.shouList();
|
||||
return Result.success(askRentList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result addAskRent(AskRent askRent){
|
||||
Integer i = askRentMapper.addAskRent(askRent);
|
||||
return Result.success(i>0?200:500,i>0?"发表成功!!!!":"发表失败!!!!");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.bwie.background.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 求购controller层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/buy")
|
||||
public class AskBuyController {
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.bwie.background.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 求租controller层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rent")
|
||||
public class AskRentController {
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.bwie.background.seriver;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bwie.common.domain.AskBuy;
|
||||
|
||||
public interface AskBuyService extends IService<AskBuy> {
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package com.bwie.background.seriver;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bwie.common.domain.AskRent;
|
||||
|
||||
public interface AskRentService extends IService<AskRent> {
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.bwie.background.seriver.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.background.mapper.AskBuyMapper;
|
||||
import com.bwie.background.seriver.AskBuyService;
|
||||
import com.bwie.common.domain.AskBuy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 求购
|
||||
*/
|
||||
@Service
|
||||
public class AskBuyServiceImpl extends ServiceImpl<AskBuyMapper, AskBuy> implements AskBuyService {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.bwie.background.seriver.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.background.mapper.AskRentMapper;
|
||||
import com.bwie.background.seriver.AskRentService;
|
||||
import com.bwie.common.domain.AskRent;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 求租
|
||||
*/
|
||||
@Service
|
||||
public class AskRentServiceImpl extends ServiceImpl<AskRentMapper, AskRent> implements AskRentService {
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,5 +1,14 @@
|
|||
<?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.bwie.background.mapper.AskBuyMapper">
|
||||
<mapper namespace="com.bwie.ask.mapper.AskBuyMapper">
|
||||
|
||||
|
||||
<insert id="addAskBuy">
|
||||
INSERT INTO `xm_house`.`askbuy` (`askbuy_address`, `askbuy_title`, `dictionary_type_id`, `addr_id`, `user_id`, `askbuy_price`, `is_delete`, `create_time`, `update_time`)
|
||||
VALUES (#{askBuyAddress},#{askbuy},#{dictionaryTypeId},#{addrId},#{userId},#{askBuyPrice},#{isDelete},#{createTime},#{updateTime});
|
||||
</insert>
|
||||
|
||||
<select id="shouAll" resultType="com.bwie.common.domain.AskBuy">
|
||||
select * from askbuy
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
<?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.bwie.background.mapper.AskRentMapper">
|
||||
<mapper namespace="com.bwie.ask.mapper.AskRentMapper">
|
||||
<insert id="addAskRent">
|
||||
INSERT INTO `xm_house`.`askrent` (`askrent_address`, `askrent_title`, `dictionary_type_id`, `addr_id`, `user_id`, `askrent_price`, `is_delete`,
|
||||
`craete_time`, `update_time`)
|
||||
VALUES (#{askRentAddress},#{askRentTitle},#{dictionaryTypeId},#{addrId},#{userId},#{askRentPrice},#{isDelete},#{createTime},#{updateTime});
|
||||
</insert>
|
||||
|
||||
<select id="shouList" resultType="com.bwie.common.domain.AskRent">
|
||||
select * from askrent
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<?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.bwie.background.mapper.BackGroundMapper">
|
||||
|
||||
</mapper>
|
|
@ -2,4 +2,5 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bwie.background.mapper.AskRentMapper">
|
||||
|
||||
<select id="shouList" resultType="com.bwie.common.domain.AskRent"></select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue