Skip to content

Commit

Permalink
feat: 新增文章详情
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeD3 committed Jan 22, 2023
1 parent 1463420 commit fda3142
Show file tree
Hide file tree
Showing 16 changed files with 9,505 additions and 5,268 deletions.
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"eslint.enable": true,
"cSpell.words": [
"nuxtjs"
]
],
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
Binary file modified backend/.tmp/data.db
Binary file not shown.
37 changes: 37 additions & 0 deletions backend/src/api/post/content-types/post/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"kind": "collectionType",
"collectionName": "posts",
"info": {
"singularName": "post",
"pluralName": "posts",
"displayName": "post",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"author": {
"type": "string"
},
"viewsCount": {
"type": "integer"
},
"rank": {
"type": "integer"
},
"body": {
"type": "richtext"
},
"articleHero": {
"type": "string"
},
"avatar": {
"type": "string"
}
}
}
9 changes: 9 additions & 0 deletions backend/src/api/post/controllers/post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* post controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::post.post');
Loading

0 comments on commit fda3142

Please sign in to comment.