获取所有标签
This commit is contained in:
@@ -235,7 +235,7 @@ public class AccountController {
|
||||
return Response.success("success");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "verifyUserEmail")
|
||||
/*@ApiOperation(value = "verifyUserEmail")
|
||||
@GetMapping("/verifyUserEmail")
|
||||
public Response<String> verifyUserEmail(@RequestParam("verifyCode") String verifyCode){
|
||||
accountService.verifyUserEmail(verifyCode);
|
||||
@@ -254,7 +254,7 @@ public class AccountController {
|
||||
public Response<String> activateNewEmail(@RequestParam("token") String token){
|
||||
accountService.activateNewEmail(token);
|
||||
return Response.success("success");
|
||||
}
|
||||
}*/
|
||||
|
||||
@PostMapping("halfPricePromotion")
|
||||
@ApiOperation(value = "十月半价活动")
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TagsController {
|
||||
|
||||
@ApiOperation("获取标签")
|
||||
@GetMapping("/getTags")
|
||||
public Response<List<Tags>> getTags(@RequestParam("userInput") String userInput) {
|
||||
public Response<List<Tags>> getTags(@RequestParam(value = "userInput", required = false) String userInput) {
|
||||
return Response.success(tagsService.getTags(userInput));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,4 +10,7 @@ import lombok.EqualsAndHashCode;
|
||||
public class Tags extends BaseEntity{
|
||||
|
||||
private String tagName;
|
||||
|
||||
// 表示标签是否正在活动中 0->不在活动中 1->在活动中
|
||||
private byte active = (byte)0;
|
||||
}
|
||||
|
||||
@@ -177,11 +177,11 @@ public interface AccountService extends IService<Account> {
|
||||
|
||||
void editUserName(String newUserName);
|
||||
|
||||
void verifyUserEmail(String verifyCode);
|
||||
/*void verifyUserEmail(String verifyCode);
|
||||
|
||||
void changeUserEmail(String newMailbox);
|
||||
|
||||
void activateNewEmail(String token);
|
||||
void activateNewEmail(String token);*/
|
||||
|
||||
String updateNoLoginRequiredNew(NoLoginRequiredDTO noLoginRequiredDTO, HttpServletRequest request);
|
||||
|
||||
|
||||
@@ -1863,7 +1863,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
}
|
||||
}
|
||||
|
||||
// 验证是否是本人进行邮箱绑定更改
|
||||
/*// 验证是否是本人进行邮箱绑定更改
|
||||
public void verifyUserEmail(String verifyCode){
|
||||
// 向旧邮箱发送验证码,以保证是当前邮箱拥有者在进行更改
|
||||
String userEmail = baseMapper.selectById(UserContext.getUserHolder().getId()).getUserEmail();
|
||||
@@ -1896,7 +1896,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
// 验证激活链接
|
||||
public void activateNewEmail(String token){
|
||||
// 获取链接地址信息,更新指定用户邮箱
|
||||
|
||||
String emailAndId = jwtTokenHelper.parseToEmailAndId(token);
|
||||
String newMailbox = emailAndId.substring(0, emailAndId.lastIndexOf("_"));
|
||||
String accountId = emailAndId.substring(emailAndId.lastIndexOf("_") + 1);
|
||||
@@ -1918,7 +1917,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
account.setId(Long.parseLong(accountId));
|
||||
baseMapper.updateById(account);
|
||||
log.info("邮箱绑定更改完成,用户id:{},新邮箱:{}", accountId, newMailbox);
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public String googleCallback(String code, HttpSession session) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.ai.da.mapper.primary.entity.Tags;
|
||||
import com.ai.da.service.TagsService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -19,7 +20,10 @@ public class TagsServiceImpl extends ServiceImpl<TagsMapper, Tags> implements Ta
|
||||
public List<Tags> getTags(String tagPrefix){
|
||||
// 1、根据tag前缀,查询
|
||||
QueryWrapper<Tags> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.likeRight("tag_name", tagPrefix);
|
||||
if (!StringUtil.isNullOrEmpty(tagPrefix)) {
|
||||
queryWrapper.like("tag_name", tagPrefix);
|
||||
}
|
||||
queryWrapper.orderByDesc("id").last("limit 10");
|
||||
|
||||
// 需返回标签内容和id
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
|
||||
Reference in New Issue
Block a user