修改bug 完善文档
This commit is contained in:
@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jiayunet.pojo.po.SkillTag;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 技能标签Mapper
|
||||
@@ -19,6 +18,6 @@ public interface SkillTagMapper extends CommonMapper<SkillTag> {
|
||||
* INSERT IGNORE:依靠 name 唯一索引去重,并发安全
|
||||
* <p>id 由调用方传入(雪花算法生成),重复 name 时忽略插入</p>
|
||||
*/
|
||||
@Insert("INSERT IGNORE INTO bg_skill_tag (id, name, create_time) VALUES (#{id}, #{name}, #{createTime})")
|
||||
int insertIgnore(@Param("id") Long id, @Param("name") String name, @Param("createTime") Instant createTime);
|
||||
@Insert("INSERT IGNORE INTO bg_skill_tag (id, name) VALUES (#{id}, #{name})")
|
||||
int insertIgnore(@Param("id") Long id, @Param("name") String name);
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ public class UserProfileAnalyzeService {
|
||||
* 查找或创建技能标签(依靠数据库唯一索引保证并发安全)
|
||||
*/
|
||||
private Long findOrCreateSkillTag(String name) {
|
||||
skillTagMapper.insertIgnore(IdWorker.getId(), name, Instant.now());
|
||||
skillTagMapper.insertIgnore(IdWorker.getId(), name);
|
||||
SkillTag tag = skillTagMapper.selectOne(new LambdaQueryWrapper<SkillTag>().eq(SkillTag::getName, name).last("LIMIT 1"));
|
||||
return tag != null ? tag.getId() : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user