diff --git a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/BusComments.java b/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/BusComments.java deleted file mode 100644 index d139f28..0000000 --- a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/BusComments.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.zm.plus.web.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import cn.zm.mybatis.utils.ObjectConvert; -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; -import cn.zm.plus.web.entity.vo.BusCommentsVO; - -@Data -@Accessors(chain = true) -@TableName("bus_comments") -@ApiModel(value="BusComments对象", description="业务评论表") -public class BusComments extends ObjectConvert{ - @ApiModelProperty(value = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @ApiModelProperty(value = "父评论id") - private Long parentId; - @ApiModelProperty(value = "内容") - private String content; - @ApiModelProperty(value = "点赞") - private Integer like; - @ApiModelProperty(value = "评论时间") - @TableField("createTime") - private LocalDateTime createTime; -} - diff --git a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/dto/BusCommentsDTO.java b/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/dto/BusCommentsDTO.java deleted file mode 100644 index beac57b..0000000 --- a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/dto/BusCommentsDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.zm.plus.web.entity.dto; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import cn.zm.mybatis.utils.ObjectConvert; -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; -import cn.zm.plus.web.entity.BusComments; - -@Data -@Accessors(chain = true) -@TableName("bus_comments") -@ApiModel(value="BusCommentsDTO对象", description="业务评论表") -public class BusCommentsDTO extends ObjectConvert{ - @ApiModelProperty(value = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @ApiModelProperty(value = "父评论id") - private Long parentId; - @ApiModelProperty(value = "内容") - private String content; - @ApiModelProperty(value = "点赞") - private Integer like; - @ApiModelProperty(value = "评论时间") - @TableField("createTime") - private LocalDateTime createTime; -} - diff --git a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/vo/BusCommentsVO.java b/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/vo/BusCommentsVO.java deleted file mode 100644 index eacf1c9..0000000 --- a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/entity/vo/BusCommentsVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.zm.plus.web.entity.vo; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import cn.zm.mybatis.utils.ObjectConvert; -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -@TableName("bus_comments") -@ApiModel(value="BusCommentsVO对象", description="业务评论表") -public class BusCommentsVO { - @ApiModelProperty(value = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @ApiModelProperty(value = "父评论id") - private Long parentId; - @ApiModelProperty(value = "内容") - private String content; - @ApiModelProperty(value = "点赞") - private Integer like; - @ApiModelProperty(value = "评论时间") - @TableField("createTime") - private LocalDateTime createTime; -} - diff --git a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/service/IBusCommentsService.java b/generator/mybatis-plus/src/main/java/cn/zm/plus/web/service/IBusCommentsService.java deleted file mode 100644 index cde3e51..0000000 --- a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/service/IBusCommentsService.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.zm.plus.web.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import cn.zm.plus.web.entity.BusComments; -import com.baomidou.mybatisplus.extension.service.IService; -import cn.zm.plus.web.entity.dto.BusCommentsDTO; -import cn.zm.plus.web.entity.vo.BusCommentsVO; - -public interface IBusCommentsService extends IService { - /** - * 分页查询 - * - * @param page 分页信息 - * @param BusComments 业务评论表入参 - * @return 分页结果 - */ - IPage selectByPage(IPage page, BusCommentsDTO BusComments); -} diff --git a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/service/impl/BusCommentsServiceImpl.java b/generator/mybatis-plus/src/main/java/cn/zm/plus/web/service/impl/BusCommentsServiceImpl.java deleted file mode 100644 index 20b5b9f..0000000 --- a/generator/mybatis-plus/src/main/java/cn/zm/plus/web/service/impl/BusCommentsServiceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.zm.plus.web.service.impl; - -import cn.zm.plus.web.entity.BusComments; -import cn.zm.plus.web.mapper.BusCommentsMapper; -import cn.zm.plus.web.service.IBusCommentsService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.baomidou.mybatisplus.core.metadata.IPage; -import cn.zm.plus.web.entity.dto.BusCommentsDTO; -import cn.zm.plus.web.entity.vo.BusCommentsVO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import cn.zm.plus.utils.ConvertUtil; - - -@Service -@Transactional(rollbackFor = Exception.class) -public class BusCommentsServiceImpl extends ServiceImpl implements IBusCommentsService { - @Override - public IPage selectByPage(IPage page, BusCommentsDTO bus_comments) { - IPage bus_commentsPage = baseMapper.selectPage(page, new QueryWrapper<>(bus_comments.convert())); - return ConvertUtil.buildPage(bus_commentsPage); - } -} diff --git a/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/ViewScenicSpotCommentsUserController.java b/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/ViewScenicSpotCommentsUserController.java new file mode 100644 index 0000000..dd6e55b --- /dev/null +++ b/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/ViewScenicSpotCommentsUserController.java @@ -0,0 +1,56 @@ +package cn.zm.trip.restful; + +import cn.zm.common.base.ResResult; +import cn.zm.mybatis.base.BaseController; +import cn.zm.trip.entity.dto.ViewScenicSpotCommentsUserDTO; +import cn.zm.trip.entity.vo.ViewScenicSpotCommentsUserVO; +import cn.zm.trip.service.IViewScenicSpotCommentsUserService; +import org.springframework.web.bind.annotation.RestController; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.Api; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import java.util.Objects; +import java.util.List; + +/** + * VIEW + * @author 十渊 + * @since 2022-07-12 + */ +@RequestMapping("viewScenicSpotCommentsUser") +@RestController +@Api(tags = "视图-景点评论用户关联") +public class ViewScenicSpotCommentsUserController extends BaseController { + + @Resource + private IViewScenicSpotCommentsUserService viewScenicSpotCommentsUserService; + + @GetMapping + @ApiOperation("VIEWpage查询") + // @ApiImplicitParams({ + // @ApiImplicitParam(name = "page", value = "当前页数", defaultValue = "1"), + // @ApiImplicitParam(name = "size", value = "每页个数", defaultValue = "10"), + // @ApiImplicitParam(name = "orderByColumn", value = "排序字段"), + // @ApiImplicitParam(name = "isDesc", value = "是否降序") + // }) + public ResResult> getByPage(@Validated ViewScenicSpotCommentsUserDTO viewScenicSpotCommentsUser) { + // TODO 分页查询 + IPage page = viewScenicSpotCommentsUserService.selectByPage(getPage(), viewScenicSpotCommentsUser); + return ResResult.succ(page); + } + + + @GetMapping("{id}") + @ApiOperation("VIEW查询(id)") + public ResResult get(@PathVariable String id) { + // TODO 查询 + boolean aNull = Objects.isNull(viewScenicSpotCommentsUserService.getById(id)); + return ResResult.succ(aNull ? null : viewScenicSpotCommentsUserService.getById(id).convert()); + } + +} diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/ViewScenicSpotCommentsUser.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/ViewScenicSpotCommentsUser.java new file mode 100644 index 0000000..15776a3 --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/ViewScenicSpotCommentsUser.java @@ -0,0 +1,29 @@ +package cn.zm.trip.entity; + +import cn.zm.trip.entity.vo.ViewScenicSpotCommentsUserVO; +import com.baomidou.mybatisplus.annotation.TableName; +import cn.zm.mybatis.utils.ObjectConvert; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +@TableName("view_scenic_spot_comments_user") +@ApiModel(value="ViewScenicSpotCommentsUser对象", description="VIEW") +public class ViewScenicSpotCommentsUser extends ObjectConvert{ + @ApiModelProperty(value = "名称") + private String name; + @ApiModelProperty(value = "头像") + private String avatar; + @ApiModelProperty(value = "电话号码") + private String phone; + @ApiModelProperty(value = "简介") + private String intro; + @ApiModelProperty(value = "父评论id") + private Long parentId; + @ApiModelProperty(value = "内容") + private String content; +} + diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/ViewScenicSpotCommentsUserDTO.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/ViewScenicSpotCommentsUserDTO.java new file mode 100644 index 0000000..0f05f47 --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/ViewScenicSpotCommentsUserDTO.java @@ -0,0 +1,29 @@ +package cn.zm.trip.entity.dto; + +import cn.zm.trip.entity.ViewScenicSpotCommentsUser; +import com.baomidou.mybatisplus.annotation.TableName; +import cn.zm.mybatis.utils.ObjectConvert; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +@TableName("view_scenic_spot_comments_user") +@ApiModel(value="ViewScenicSpotCommentsUserDTO对象", description="VIEW") +public class ViewScenicSpotCommentsUserDTO extends ObjectConvert{ + @ApiModelProperty(value = "名称") + private String name; + @ApiModelProperty(value = "头像") + private String avatar; + @ApiModelProperty(value = "电话号码") + private String phone; + @ApiModelProperty(value = "简介") + private String intro; + @ApiModelProperty(value = "父评论id") + private Long parentId; + @ApiModelProperty(value = "内容") + private String content; +} + diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/ViewScenicSpotCommentsUserVO.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/ViewScenicSpotCommentsUserVO.java new file mode 100644 index 0000000..5fc6733 --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/ViewScenicSpotCommentsUserVO.java @@ -0,0 +1,28 @@ +package cn.zm.trip.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableName; +import cn.zm.mybatis.utils.ObjectConvert; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +@TableName("view_scenic_spot_comments_user") +@ApiModel(value="ViewScenicSpotCommentsUserVO对象", description="VIEW") +public class ViewScenicSpotCommentsUserVO { + @ApiModelProperty(value = "名称") + private String name; + @ApiModelProperty(value = "头像") + private String avatar; + @ApiModelProperty(value = "电话号码") + private String phone; + @ApiModelProperty(value = "简介") + private String intro; + @ApiModelProperty(value = "父评论id") + private Long parentId; + @ApiModelProperty(value = "内容") + private String content; +} + diff --git a/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/ViewScenicSpotCommentsUserMapper.java b/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/ViewScenicSpotCommentsUserMapper.java new file mode 100644 index 0000000..68a9d91 --- /dev/null +++ b/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/ViewScenicSpotCommentsUserMapper.java @@ -0,0 +1,10 @@ +package cn.zm.trip.mapper; + +import cn.zm.trip.entity.ViewScenicSpotCommentsUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ViewScenicSpotCommentsUserMapper extends BaseMapper { + +} diff --git a/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IViewScenicSpotCommentsUserService.java b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IViewScenicSpotCommentsUserService.java new file mode 100644 index 0000000..44bd8a1 --- /dev/null +++ b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IViewScenicSpotCommentsUserService.java @@ -0,0 +1,18 @@ +package cn.zm.trip.service; + +import cn.zm.trip.entity.ViewScenicSpotCommentsUser; +import cn.zm.trip.entity.dto.ViewScenicSpotCommentsUserDTO; +import cn.zm.trip.entity.vo.ViewScenicSpotCommentsUserVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface IViewScenicSpotCommentsUserService extends IService { + /** + * 分页查询 + * + * @param page 分页信息 + * @param ViewScenicSpotCommentsUser VIEW入参 + * @return 分页结果 + */ + IPage selectByPage(IPage page, ViewScenicSpotCommentsUserDTO ViewScenicSpotCommentsUser); +} diff --git a/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/ViewScenicSpotCommentsUserServiceImpl.java b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/ViewScenicSpotCommentsUserServiceImpl.java new file mode 100644 index 0000000..b075740 --- /dev/null +++ b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/ViewScenicSpotCommentsUserServiceImpl.java @@ -0,0 +1,24 @@ +package cn.zm.trip.service.impl; + +import cn.zm.mybatis.utils.ConvertUtil; +import cn.zm.trip.entity.ViewScenicSpotCommentsUser; +import cn.zm.trip.entity.dto.ViewScenicSpotCommentsUserDTO; +import cn.zm.trip.entity.vo.ViewScenicSpotCommentsUserVO; +import cn.zm.trip.mapper.ViewScenicSpotCommentsUserMapper; +import cn.zm.trip.service.IViewScenicSpotCommentsUserService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + + +@Service +@Transactional(rollbackFor = Exception.class) +public class ViewScenicSpotCommentsUserServiceImpl extends ServiceImpl implements IViewScenicSpotCommentsUserService { + @Override + public IPage selectByPage(IPage page, ViewScenicSpotCommentsUserDTO view_scenic_spot_comments_user) { + IPage view_scenic_spot_comments_userPage = baseMapper.selectPage(page, new QueryWrapper<>(view_scenic_spot_comments_user.convert())); + return ConvertUtil.buildPage(view_scenic_spot_comments_userPage); + } +}