-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
432 additions
and
1 deletion.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
...erver/trip-web-api/src/main/java/cn/zm/trip/restful/RelaScenicSpotCommentsController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<IPage<RelaScenicSpotCommentsVO>> getByPage(@Validated RelaScenicSpotCommentsDTO relaScenicSpotComments) { | ||
// TODO 分页查询 | ||
IPage<RelaScenicSpotCommentsVO> 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<RelaScenicSpotCommentsVO>> list(@Validated @RequestBody RelaScenicSpotCommentsDTO relaScenicSpotComments) { | ||
// // TODO 分页查询 | ||
// IPage<RelaScenicSpotCommentsVO> page = relaScenicSpotCommentsService.list(getPage(), relaScenicSpotComments); | ||
// return ResResult.succ(page); | ||
// } | ||
|
||
@GetMapping("{id}") | ||
@ApiOperation("关联景区评论关联表查询(id)") | ||
public ResResult<RelaScenicSpotCommentsVO> 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("修改成功"); | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
...-web-server/trip-web-api/src/main/java/cn/zm/trip/restful/RelaUserCommentsController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<IPage<RelaUserCommentsVO>> getByPage(@Validated RelaUserCommentsDTO relaUserComments) { | ||
// TODO 分页查询 | ||
IPage<RelaUserCommentsVO> 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<RelaUserCommentsVO>> list(@Validated @RequestBody RelaUserCommentsDTO relaUserComments) { | ||
// // TODO 分页查询 | ||
// IPage<RelaUserCommentsVO> page = relaUserCommentsService.list(getPage(), relaUserComments); | ||
// return ResResult.succ(page); | ||
// } | ||
|
||
@GetMapping("{id}") | ||
@ApiOperation("关联用户评论表查询(id)") | ||
public ResResult<RelaUserCommentsVO> 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("修改成功"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/RelaScenicSpotComments.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<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; | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/RelaUserComments.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<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; | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
...server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/RelaScenicSpotCommentsDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<RelaScenicSpotComments>{ | ||
@ApiModelProperty(value = "ID") | ||
@TableId(value = "id", type = IdType.AUTO) | ||
private Long id; | ||
@ApiModelProperty(value = "景点id") | ||
private Long scenicSpotId; | ||
@ApiModelProperty(value = "评论id") | ||
private Long commentsId; | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/dto/RelaUserCommentsDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<RelaUserComments>{ | ||
@ApiModelProperty(value = "ID") | ||
@TableId(value = "id", type = IdType.AUTO) | ||
private Long id; | ||
@ApiModelProperty(value = "用户id") | ||
private Long userId; | ||
@ApiModelProperty(value = "评论id") | ||
private String commentsId; | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
...b-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/RelaScenicSpotCommentsVO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
trip-web-server/trip-web-entity/src/main/java/cn/zm/trip/entity/vo/RelaUserCommentsVO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
...-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/RelaScenicSpotCommentsMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<RelaScenicSpotComments> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
trip-web-server/trip-web-mapper/src/main/java/cn/zm/trip/mapper/RelaUserCommentsMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<RelaUserComments> { | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...ver/trip-web-service/src/main/java/cn/zm/trip/service/IRelaScenicSpotCommentsService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<RelaScenicSpotComments> { | ||
/** | ||
* 分页查询 | ||
* | ||
* @param page 分页信息 | ||
* @param RelaScenicSpotComments 关联景区评论关联表入参 | ||
* @return 分页结果 | ||
*/ | ||
IPage<RelaScenicSpotCommentsVO> selectByPage(IPage<RelaScenicSpotComments> page, RelaScenicSpotCommentsDTO RelaScenicSpotComments); | ||
} |
Oops, something went wrong.