Skip to content

Commit

Permalink
Rebuilde DB
Browse files Browse the repository at this point in the history
  • Loading branch information
niziming committed Jul 12, 2022
1 parent 7ab7137 commit 41280c5
Show file tree
Hide file tree
Showing 34 changed files with 63 additions and 1,219 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import cn.zm.common.base.ResResult;
import cn.zm.common.enums.ResEnum;
import cn.zm.common.utils.AssertUtil;
import cn.zm.trip.entity.ViewUserAccount;
import cn.zm.trip.entity.dto.ViewUserAccountDTO;
import cn.zm.trip.entity.vo.ViewUserAccountVO;
import cn.zm.trip.service.IViewUserAccountService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
Expand All @@ -22,23 +18,23 @@
@RequestMapping("auth")
@Api(tags = "权限认证")
public class AuthController {
@Resource
private IViewUserAccountService userAccountService;


@PostMapping("/login")
@ApiOperation("登陆")
public ResResult<ViewUserAccountVO> login(@RequestBody ViewUserAccountDTO dto) {
ViewUserAccount one = userAccountService.getOne(new QueryWrapper<>(dto.convert()));
AssertUtil.assertNonNull(one, ResEnum.INVALID_PARAMS);
return ResResult.succ(one.convert());
}

@PostMapping("/register")
@ApiOperation("注册")
public ResResult register(@RequestBody @Validated ViewUserAccountDTO dto) {
userAccountService.register(dto);
return ResResult.succ();
}
// @Resource
// private IViewUserAccountService userAccountService;
//
//
// @PostMapping("/login")
// @ApiOperation("登陆")
// public ResResult<ViewUserAccountVO> login(@RequestBody ViewUserAccountDTO dto) {
// ViewUserAccount one = userAccountService.getOne(new QueryWrapper<>(dto.convert()));
// AssertUtil.assertNonNull(one, ResEnum.INVALID_PARAMS);
// return ResResult.succ(one.convert());
// }
//
// @PostMapping("/register")
// @ApiOperation("注册")
// public ResResult register(@RequestBody @Validated ViewUserAccountDTO dto) {
// userAccountService.register(dto);
// return ResResult.succ();
// }

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,21 @@
import cn.zm.common.base.ResResult;
import cn.zm.mybatis.base.BaseController;
import cn.zm.trip.entity.BusComments;
import cn.zm.trip.entity.RelaScenicSpotComments;
import cn.zm.trip.entity.RelaUserComments;
import cn.zm.trip.entity.dto.BaseScenicSpotDTO;
import cn.zm.trip.entity.dto.BusCommentsDTO;
import cn.zm.trip.entity.dto.ScenicSpotCommentsDTO;
import cn.zm.trip.entity.dto.ScenicSpotCommentsUserDTO;
import cn.zm.trip.entity.vo.BusCommentsVO;
import cn.zm.trip.service.IBusCommentsService;
import cn.zm.trip.service.IRelaScenicSpotCommentsService;
import cn.zm.trip.service.IRelaUserCommentsService;
import cn.zm.trip.service.IViewScenicSpotCommentsUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
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;

/**
* 业务评论表
Expand All @@ -43,12 +34,8 @@ public class BusCommentsController extends BaseController {
@Resource
private IBusCommentsService busCommentsService;

@Resource
private IRelaScenicSpotCommentsService relaScenicSpotCommentsService;


@Resource
private IRelaUserCommentsService relaUserCommentsService;
// @Resource
// private IRelaUserCommentsService relaUserCommentsService;


@GetMapping
Expand All @@ -75,18 +62,18 @@ public ResResult scenicSpotCommentsSave(@RequestBody @Validated ScenicSpotCommen
busCommentsService.save(comments);

log.info("评论景点-景点评论关联存库");
relaScenicSpotCommentsService.save(RelaScenicSpotComments.builder()
.scenicSpotId(scenicSpotDTO.getId())
.commentsId(comments.getId())
.build());
// relaScenicSpotCommentsService.save(RelaScenicSpotComments.builder()
// .scenicSpotId(scenicSpotDTO.getId())
// .commentsId(comments.getId())
// .build());
log.info("评论景点-用户评论关联存库");

relaUserCommentsService.save(
RelaUserComments.builder()
.commentsId(comments.getId())
.userId(dto.getUserDTO().getId())
.build()
);
// relaUserCommentsService.save(
// RelaUserComments.builder()
// .commentsId(comments.getId())
// .userId(dto.getUserDTO().getId())
// .build()
// );

return ResResult.succ("新增成功");
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 41280c5

Please sign in to comment.