Skip to content

Conversation

@WodenJay
Copy link
Owner

PR for codex to fix bug

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +16 to +17
SELECT * FROM biz_sensitive_word
WHERE 1=1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add missing biz_sensitive_word schema

The new mapper now queries biz_sensitive_word (see the SELECT * FROM biz_sensitive_word in this mapper), but neither dblog.sql nor docs/docker/mysql/init_data.sql define that table—only config and permission seed data were added. With the provided init scripts, any call to findPageBreakByCondition/findAllEnabled (e.g., loading the sensitive-word list or running comment moderation) will fail at runtime with “Table '…biz_sensitive_word' doesn't exist”. Please add the table DDL to the schema scripts so these endpoints can run.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex I have write sql code to add the new table, through the cli to run them instead of the .sql file. Codes are as follow:

-- 添加敏感词相关配置  
INSERT INTO `sys_config`(`config_key`, `config_value`, `create_time`, `update_time`) VALUES   
('sensitive.word.enable', '1', now(), now()),  
('sensitive.word.strategy', 'pending', now(), now()),  
('sensitive.word.email.notify', '0', now(), now());
-- 添加敏感词管理权限  
INSERT INTO `sys_resources` VALUES (91, '敏感词管理', 'menu', '/sensitiveWords', 'sensitiveWords', 40, 8, 0, 1, 'fa fa-shield', now(), now());  
INSERT INTO `sys_resources` VALUES (92, '查看敏感词', 'button', NULL, 'sensitive:words', 91, 2, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (93, '新增敏感词', 'button', NULL, 'sensitive:word:add', 91, 3, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (94, '编辑敏感词', 'button', NULL, 'sensitive:word:edit', 91, 4, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (95, '删除敏感词', 'button', NULL, 'sensitive:word:delete', 91, 5, 0, 1, NULL, now(), now());

Based on these codes, continue to check whether there are any bugs. PAY ATTENTION

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 56 to 60
// 转换为业务对象
List<SensitiveWord> boList = this.convertToBo(list);

// 构建分页结果
PageInfo<SensitiveWord> pageInfo = new PageInfo<>(boList);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve pagination metadata when mapping sensitive words

Pagination metadata is lost here: the mapper returns a Page object carrying total/pages, but converting it to boList and constructing new PageInfo<>(boList) discards that information, so the API will report total equal to the current page size and pageNum reset to 1 whenever the caller requests later pages. Build the PageInfo from the original mapper list and then replace its list (as done in other services) to keep correct totals.

Useful? React with 👍 / 👎.

Comment on lines +16 to +17
SELECT * FROM biz_sensitive_word
WHERE 1=1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Missing DDL for biz_sensitive_word table

The mapper now queries biz_sensitive_word, but there is no schema definition for this table in the repository (searching the docs and init SQL scripts for biz_sensitive_word returns only this mapper). Deployments relying on the provided init SQL will hit “Table 'biz_sensitive_word' doesn't exist” when findPageBreakByCondition or findAllEnabled runs. A creation statement needs to be added to the init scripts alongside the new inserts.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex I understand your meaning, but I do not intend to change the init_sql.sql or other code file, which will not be ran anymore, because the database has been created. So if I should add something to the database, the only way I agreed is use the cli to run sql.

Additionaly, I plan to run this code to add the table I need. Is this correct?

-- 添加敏感词相关配置  
INSERT INTO `sys_config`(`config_key`, `config_value`, `create_time`, `update_time`) VALUES   
('sensitive.word.enable', '1', now(), now()),  
('sensitive.word.strategy', 'pending', now(), now()),  
('sensitive.word.email.notify', '0', now(), now());
-- 添加敏感词管理权限  
INSERT INTO `sys_resources` VALUES (91, '敏感词管理', 'menu', '/sensitiveWords', 'sensitiveWords', 40, 8, 0, 1, 'fa fa-shield', now(), now());  
INSERT INTO `sys_resources` VALUES (92, '查看敏感词', 'button', NULL, 'sensitive:words', 91, 2, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (93, '新增敏感词', 'button', NULL, 'sensitive:word:add', 91, 3, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (94, '编辑敏感词', 'button', NULL, 'sensitive:word:edit', 91, 4, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (95, '删除敏感词', 'button', NULL, 'sensitive:word:delete', 91, 5, 0, 1, NULL, now(), now());

Based on the conditions, provide me a new code review report. The more detailed, the better it is.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +15 to +18
<select id="findPageBreakByCondition" parameterType="com.zyd.blog.business.vo.SensitiveWordConditionVO" resultMap="rm">
SELECT * FROM biz_sensitive_word
WHERE 1=1
<if test="word != null and word != ''">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Define biz_sensitive_word table for new mapper

The mapper now issues SELECT * FROM biz_sensitive_word but the repository contains no DDL for a biz_sensitive_word table (rg for sensitive_word or biz_sensitive_word in *.sql returns nothing). Once any of the new endpoints hits findPageBreakByCondition/findAllEnabled, MyBatis will raise “Table '...biz_sensitive_word' doesn't exist”, so the sensitive-word feature cannot function until the table schema is added.

Useful? React with 👍 / 👎.

Comment on lines 56 to 60
// 转换为业务对象
List<SensitiveWord> boList = this.convertToBo(list);

// 构建分页结果
PageInfo<SensitiveWord> pageInfo = new PageInfo<>(boList);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pagination loses totals after converting list

The sensitive-word pagination builds PageInfo from the converted boList rather than the PageHelper result, so the PageInfo no longer carries the total/count metadata from the database and will report only the current page size as the total when more rows exist. Calls to /sensitive/word/list will therefore misreport pagination beyond the first page; construct PageInfo from the PageHelper list and then set the converted list (as done elsewhere) to preserve totals and page metadata.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex well, how do you plan to fix the bug?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Testing

  • ⚠️ Not run (not requested).

View task →

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Testing

  • ⚠️ Not run (not requested).

View task →

@codex I see your code, and I have a question.
Do I need to run this code (as follows) in the mysql cli? Or the code you give in the *.sql is enouth. I'm not clear about it.

-- 添加敏感词相关配置  
INSERT INTO `sys_config`(`config_key`, `config_value`, `create_time`, `update_time`) VALUES   
('sensitive.word.enable', '1', now(), now()),  
('sensitive.word.strategy', 'pending', now(), now()),  
('sensitive.word.email.notify', '0', now(), now());
-- 添加敏感词管理权限  
INSERT INTO `sys_resources` VALUES (91, '敏感词管理', 'menu', '/sensitiveWords', 'sensitiveWords', 40, 8, 0, 1, 'fa fa-shield', now(), now());  
INSERT INTO `sys_resources` VALUES (92, '查看敏感词', 'button', NULL, 'sensitive:words', 91, 2, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (93, '新增敏感词', 'button', NULL, 'sensitive:word:add', 91, 3, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (94, '编辑敏感词', 'button', NULL, 'sensitive:word:edit', 91, 4, 0, 1, NULL, now(), now());  
INSERT INTO `sys_resources` VALUES (95, '删除敏感词', 'button', NULL, 'sensitive:word:delete', 91, 5, 0, 1, NULL, now(), now());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Testing

  • ⚠️ Not run (not requested)

Deployment note
The CLI inserts you shared add config and permissions, but they don’t create the biz_sensitive_word table. Apply the new DDL from the schema/init SQL (or run that CREATE TABLE statement directly in MySQL) before using the sensitive-word APIs; then you can run your insert statements to seed config and permissions as needed. dblog.sqlL314-L340 docs/docker/mysql/init_data.sqlL1-L20

View task →

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Testing

  • ⚠️ Not run (not requested)

Notes

  • If your database is already running, you can execute the SQL statements in docs/sensitive_word_manual_sql.md directly in the MySQL CLI to create the biz_sensitive_word table and seed the related config and permissions without rerunning other init files. docs/sensitive_word_manual_sql.mdL1-L36

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants