diff --git a/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/RelaScenicSpotCommentsController.java b/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/RelaScenicSpotCommentsController.java new file mode 100644 index 0000000..a89ed83 --- /dev/null +++ b/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/RelaScenicSpotCommentsController.java @@ -0,0 +1,84 @@ +package cn.zm.trip.restful; + +import cn.zm.common.base.ResResult; +import cn.zm.mybatis.base.BaseController; +import cn.zm.trip.entity.dto.RelaScenicSpotCommentsDTO; +import cn.zm.trip.entity.vo.RelaScenicSpotCommentsVO; +import cn.zm.trip.service.IRelaScenicSpotCommentsService; +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; + +/** + * 关联景区评论关联表 + * @author 十渊 + * @since 2022-07-12 + */ +@RequestMapping("relaScenicSpotComments") +@RestController +@Api(tags = "关联景区评论关联表") +public class RelaScenicSpotCommentsController extends BaseController { + + @Resource + private IRelaScenicSpotCommentsService relaScenicSpotCommentsService; + + @GetMapping + @ApiOperation("关联景区评论关联表page查询") + public ResResult> getByPage(@Validated RelaScenicSpotCommentsDTO relaScenicSpotComments) { + // TODO 分页查询 + IPage page = relaScenicSpotCommentsService.selectByPage(getPage(), relaScenicSpotComments); + return ResResult.succ(page); + } + + // @PostMapping("list") + // @ApiOperation("关联景区评论关联表list查询") + // @ApiImplicitParams({ + // @ApiImplicitParam(name = "orderByColumn", value = "排序字段"), + // @ApiImplicitParam(name = "isDesc", value = "是否降序") + // }) + // public ResResult> list(@Validated @RequestBody RelaScenicSpotCommentsDTO relaScenicSpotComments) { + // // TODO 分页查询 + // IPage page = relaScenicSpotCommentsService.list(getPage(), relaScenicSpotComments); + // return ResResult.succ(page); + // } + + @GetMapping("{id}") + @ApiOperation("关联景区评论关联表查询(id)") + public ResResult get(@PathVariable String id) { + // TODO 查询 + boolean aNull = Objects.isNull(relaScenicSpotCommentsService.getById(id)); + return ResResult.succ(aNull ? null : relaScenicSpotCommentsService.getById(id).convert()); + } + + @PostMapping + @ApiOperation("关联景区评论关联表新增") + public ResResult add(@RequestBody @Validated RelaScenicSpotCommentsDTO relaScenicSpotComments) { + // TODO 新增 + relaScenicSpotCommentsService.save(relaScenicSpotComments.convert()); + return ResResult.succ("新增成功"); + } + + @DeleteMapping("{id}") + @ApiOperation("关联景区评论关联表删除") + public ResResult del(@PathVariable String id) { + // TODO 删除 + relaScenicSpotCommentsService.removeById(id); + return ResResult.succ("删除成功"); + } + + @PutMapping + @ApiOperation("关联景区评论关联表修改") + public ResResult update(@RequestBody @Validated RelaScenicSpotCommentsDTO relaScenicSpotComments) { + // TODO 修改 + relaScenicSpotCommentsService.updateById(relaScenicSpotComments.convert()); + return ResResult.succ("修改成功"); + } +} diff --git a/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/RelaUserCommentsController.java b/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/RelaUserCommentsController.java new file mode 100644 index 0000000..62e879b --- /dev/null +++ b/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/RelaUserCommentsController.java @@ -0,0 +1,90 @@ +package cn.zm.trip.restful; + +import cn.zm.common.base.ResResult; +import cn.zm.mybatis.base.BaseController; +import cn.zm.trip.entity.dto.RelaUserCommentsDTO; +import cn.zm.trip.entity.vo.RelaUserCommentsVO; +import cn.zm.trip.service.IRelaUserCommentsService; +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; + +/** + * 关联用户评论表 + * @author 十渊 + * @since 2022-07-12 + */ +@RequestMapping("relaUserComments") +@RestController +@Api(tags = "关联用户评论表") +public class RelaUserCommentsController extends BaseController { + + @Resource + private IRelaUserCommentsService relaUserCommentsService; + + @GetMapping + @ApiOperation("关联用户评论表page查询") + @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 RelaUserCommentsDTO relaUserComments) { + // TODO 分页查询 + IPage page = relaUserCommentsService.selectByPage(getPage(), relaUserComments); + return ResResult.succ(page); + } + + // @PostMapping("list") + // @ApiOperation("关联用户评论表list查询") + // @ApiImplicitParams({ + // @ApiImplicitParam(name = "orderByColumn", value = "排序字段"), + // @ApiImplicitParam(name = "isDesc", value = "是否降序") + // }) + // public ResResult> list(@Validated @RequestBody RelaUserCommentsDTO relaUserComments) { + // // TODO 分页查询 + // IPage page = relaUserCommentsService.list(getPage(), relaUserComments); + // return ResResult.succ(page); + // } + + @GetMapping("{id}") + @ApiOperation("关联用户评论表查询(id)") + public ResResult get(@PathVariable String id) { + // TODO 查询 + boolean aNull = Objects.isNull(relaUserCommentsService.getById(id)); + return ResResult.succ(aNull ? null : relaUserCommentsService.getById(id).convert()); + } + + @PostMapping + @ApiOperation("关联用户评论表新增") + public ResResult add(@RequestBody @Validated RelaUserCommentsDTO relaUserComments) { + // TODO 新增 + relaUserCommentsService.save(relaUserComments.convert()); + return ResResult.succ("新增成功"); + } + + @DeleteMapping("{id}") + @ApiOperation("关联用户评论表删除") + public ResResult del(@PathVariable String id) { + // TODO 删除 + relaUserCommentsService.removeById(id); + return ResResult.succ("删除成功"); + } + + @PutMapping + @ApiOperation("关联用户评论表修改") + public ResResult update(@RequestBody @Validated RelaUserCommentsDTO relaUserComments) { + // TODO 修改 + relaUserCommentsService.updateById(relaUserComments.convert()); + return ResResult.succ("修改成功"); + } +} diff --git a/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/ViewUserAccountController.java b/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/ViewUserAccountController.java index 3e94e21..931a662 100644 --- a/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/ViewUserAccountController.java +++ b/trip-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/ViewUserAccountController.java @@ -27,7 +27,7 @@ */ @RequestMapping("viewUserAccount") @RestController -@Api(tags = "VIEW用户及账户信息") +@Api(tags = "视图-用户及账户信息") public class ViewUserAccountController extends BaseController { @Resource diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/RelaScenicSpotComments.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/RelaScenicSpotComments.java new file mode 100644 index 0000000..a1aecc1 --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/RelaScenicSpotComments.java @@ -0,0 +1,26 @@ +package cn.zm.trip.entity; + +import cn.zm.trip.entity.vo.RelaScenicSpotCommentsVO; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +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("rela_scenic_spot_comments") +@ApiModel(value="RelaScenicSpotComments对象", description="关联景区评论关联表") +public class RelaScenicSpotComments extends ObjectConvert{ + @ApiModelProperty(value = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @ApiModelProperty(value = "景点id") + private Long scenicSpotId; + @ApiModelProperty(value = "评论id") + private Long commentsId; +} + diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/RelaUserComments.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/RelaUserComments.java new file mode 100644 index 0000000..148ed54 --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/RelaUserComments.java @@ -0,0 +1,26 @@ +package cn.zm.trip.entity; + +import cn.zm.trip.entity.vo.RelaUserCommentsVO; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +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("rela_user_comments") +@ApiModel(value="RelaUserComments对象", description="关联用户评论表") +public class RelaUserComments extends ObjectConvert{ + @ApiModelProperty(value = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @ApiModelProperty(value = "用户id") + private Long userId; + @ApiModelProperty(value = "评论id") + private String commentsId; +} + diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/RelaScenicSpotCommentsDTO.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/RelaScenicSpotCommentsDTO.java new file mode 100644 index 0000000..a98ae3a --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/RelaScenicSpotCommentsDTO.java @@ -0,0 +1,26 @@ +package cn.zm.trip.entity.dto; + +import cn.zm.trip.entity.RelaScenicSpotComments; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +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("rela_scenic_spot_comments") +@ApiModel(value="RelaScenicSpotCommentsDTO对象", description="关联景区评论关联表") +public class RelaScenicSpotCommentsDTO extends ObjectConvert{ + @ApiModelProperty(value = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @ApiModelProperty(value = "景点id") + private Long scenicSpotId; + @ApiModelProperty(value = "评论id") + private Long commentsId; +} + diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/RelaUserCommentsDTO.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/RelaUserCommentsDTO.java new file mode 100644 index 0000000..4ce9b9e --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/RelaUserCommentsDTO.java @@ -0,0 +1,26 @@ +package cn.zm.trip.entity.dto; + +import cn.zm.trip.entity.RelaUserComments; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +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("rela_user_comments") +@ApiModel(value="RelaUserCommentsDTO对象", description="关联用户评论表") +public class RelaUserCommentsDTO extends ObjectConvert{ + @ApiModelProperty(value = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @ApiModelProperty(value = "用户id") + private Long userId; + @ApiModelProperty(value = "评论id") + private String commentsId; +} + diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/RelaScenicSpotCommentsVO.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/RelaScenicSpotCommentsVO.java new file mode 100644 index 0000000..4d60bf8 --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/RelaScenicSpotCommentsVO.java @@ -0,0 +1,25 @@ +package cn.zm.trip.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +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("rela_scenic_spot_comments") +@ApiModel(value="RelaScenicSpotCommentsVO对象", description="关联景区评论关联表") +public class RelaScenicSpotCommentsVO { + @ApiModelProperty(value = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @ApiModelProperty(value = "景点id") + private Long scenicSpotId; + @ApiModelProperty(value = "评论id") + private Long commentsId; +} + diff --git a/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/RelaUserCommentsVO.java b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/RelaUserCommentsVO.java new file mode 100644 index 0000000..348bbfc --- /dev/null +++ b/trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/RelaUserCommentsVO.java @@ -0,0 +1,25 @@ +package cn.zm.trip.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +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("rela_user_comments") +@ApiModel(value="RelaUserCommentsVO对象", description="关联用户评论表") +public class RelaUserCommentsVO { + @ApiModelProperty(value = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @ApiModelProperty(value = "用户id") + private Long userId; + @ApiModelProperty(value = "评论id") + private String commentsId; +} + diff --git a/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/RelaScenicSpotCommentsMapper.java b/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/RelaScenicSpotCommentsMapper.java new file mode 100644 index 0000000..24e8d61 --- /dev/null +++ b/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/RelaScenicSpotCommentsMapper.java @@ -0,0 +1,10 @@ +package cn.zm.trip.mapper; + +import cn.zm.trip.entity.RelaScenicSpotComments; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface RelaScenicSpotCommentsMapper extends BaseMapper { + +} diff --git a/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/RelaUserCommentsMapper.java b/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/RelaUserCommentsMapper.java new file mode 100644 index 0000000..ca681f3 --- /dev/null +++ b/trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/RelaUserCommentsMapper.java @@ -0,0 +1,10 @@ +package cn.zm.trip.mapper; + +import cn.zm.trip.entity.RelaUserComments; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface RelaUserCommentsMapper extends BaseMapper { + +} diff --git a/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IRelaScenicSpotCommentsService.java b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IRelaScenicSpotCommentsService.java new file mode 100644 index 0000000..75859e1 --- /dev/null +++ b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IRelaScenicSpotCommentsService.java @@ -0,0 +1,18 @@ +package cn.zm.trip.service; + +import cn.zm.trip.entity.RelaScenicSpotComments; +import cn.zm.trip.entity.dto.RelaScenicSpotCommentsDTO; +import cn.zm.trip.entity.vo.RelaScenicSpotCommentsVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface IRelaScenicSpotCommentsService extends IService { + /** + * 分页查询 + * + * @param page 分页信息 + * @param RelaScenicSpotComments 关联景区评论关联表入参 + * @return 分页结果 + */ + IPage selectByPage(IPage page, RelaScenicSpotCommentsDTO RelaScenicSpotComments); +} diff --git a/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IRelaUserCommentsService.java b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IRelaUserCommentsService.java new file mode 100644 index 0000000..37a5888 --- /dev/null +++ b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/IRelaUserCommentsService.java @@ -0,0 +1,18 @@ +package cn.zm.trip.service; + +import cn.zm.trip.entity.RelaUserComments; +import cn.zm.trip.entity.dto.RelaUserCommentsDTO; +import cn.zm.trip.entity.vo.RelaUserCommentsVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface IRelaUserCommentsService extends IService { + /** + * 分页查询 + * + * @param page 分页信息 + * @param RelaUserComments 关联用户评论表入参 + * @return 分页结果 + */ + IPage selectByPage(IPage page, RelaUserCommentsDTO RelaUserComments); +} diff --git a/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/RelaScenicSpotCommentsServiceImpl.java b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/RelaScenicSpotCommentsServiceImpl.java new file mode 100644 index 0000000..4caa289 --- /dev/null +++ b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/RelaScenicSpotCommentsServiceImpl.java @@ -0,0 +1,23 @@ +package cn.zm.trip.service.impl; + +import cn.zm.mybatis.utils.ConvertUtil; +import cn.zm.trip.entity.RelaScenicSpotComments; +import cn.zm.trip.entity.dto.RelaScenicSpotCommentsDTO; +import cn.zm.trip.entity.vo.RelaScenicSpotCommentsVO; +import cn.zm.trip.mapper.RelaScenicSpotCommentsMapper; +import cn.zm.trip.service.IRelaScenicSpotCommentsService; +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 RelaScenicSpotCommentsServiceImpl extends ServiceImpl implements IRelaScenicSpotCommentsService { + @Override + public IPage selectByPage(IPage page, RelaScenicSpotCommentsDTO rela_scenic_spot_comments) { + IPage rela_scenic_spot_commentsPage = baseMapper.selectPage(page, new QueryWrapper<>(rela_scenic_spot_comments.convert())); + return ConvertUtil.buildPage(rela_scenic_spot_commentsPage); + } +} diff --git a/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/RelaUserCommentsServiceImpl.java b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/RelaUserCommentsServiceImpl.java new file mode 100644 index 0000000..9c8ebfa --- /dev/null +++ b/trip-web-server/trip-web-service/src/main/java/cn/zm/trip/service/impl/RelaUserCommentsServiceImpl.java @@ -0,0 +1,24 @@ +package cn.zm.trip.service.impl; + +import cn.zm.mybatis.utils.ConvertUtil; +import cn.zm.trip.entity.RelaUserComments; +import cn.zm.trip.entity.dto.RelaUserCommentsDTO; +import cn.zm.trip.entity.vo.RelaUserCommentsVO; +import cn.zm.trip.mapper.RelaUserCommentsMapper; +import cn.zm.trip.service.IRelaUserCommentsService; +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 RelaUserCommentsServiceImpl extends ServiceImpl implements IRelaUserCommentsService { + @Override + public IPage selectByPage(IPage page, RelaUserCommentsDTO rela_user_comments) { + IPage rela_user_commentsPage = baseMapper.selectPage(page, new QueryWrapper<>(rela_user_comments.convert())); + return ConvertUtil.buildPage(rela_user_commentsPage); + } +}