Git Product home page Git Product logo

timor.cms's People

Contributors

baiyunchen avatar jing8956 avatar twyunchen avatar ylvict avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

timor.cms's Issues

Search articles API

Request

URI: api/v1/articles
HttpMethod: GET
URI Parameters:
Request Body:

{
  “pageIndex":           int,           //页码
  "pageSize":            int,           //每页包含的文章个数
  "title":               "string",      //主标题(模糊查询)
  "author":              "string",      //作者 (模糊查询)
  "isPublished":          bool?,        //是否发布
  "startPublishDate":     DateTime?,    //起始发布时间(包含)
  "endPublishDate":       DateTime?,    //终止发布时间(包含)
  "categoryIds":         [ "string(ObjectId)[]" ], //分类ID
}

Response:

Success
Http Code: 200 OK
Response Body:

{
  "count": int, // 匹配的文章总条数
  "data":
  [
    {
      "id":               ObjectId,   //文章ID
      "title":            "string",   //主标题
      "subTitle":         "string",   //副标题
      "shortDescription": "string",   //摘要
      "content":          "string",   //文章内容
      "coverImage":       "string(ObjectId)", //封面图片
      "author":           "string",   //作者
      "isPublished":      bool,       //是否发布
      "publishDate":      DateTime,   //发布时间
      "referenceUrl":     "string",   //文章引用来源
      "visitCount":       int,        //访问次数
      "categoryIds":    [ "string(ObjectId)" ], //分类ID
      "attachmentIds":  [ "string(ObjectId)" ]  //附件
    }
  ]
}

删除文章 API

Request

URI: api/v1/articles/{id}
HttpMethod: DELETE
URI Parameters:
Request Body:

Response:

Success
Http Code: 204 NOCONTENT
Response Body:

引入数据验证框架

  • 引入FluentValidation库,用于协助数据校验
  • FluentValidation与Attribute验证结合

搭建一个基于Github的持续集成系统

  • 购买域名
  • 自动单元测试
  • 自动集成测试
  • Sonar代码静态扫描
  • 自动进行代码编译
  • 自动打包成docker镜像
  • 部署系统到K8S
  • 域名解析(备案),完成测试环境搭建

删除分类API

Request

URI: api/v1/categories/{id}
HttpMethod: DELETE
URI Parameters:
Request Body:

Response:

Success
Http Code: 204
Response Body:

更新文章 API

Request

URI: api/v1/articles/{id}
HttpMethod: PUT
URI Parameters:
Request Body:

{
  "title":            "string",                 //主标题
  "subTitle":         "string",                 //副标题
  "shortDescription": "string",                 //摘要
  "content":          "string",                 //文章内容
  "coverImage":       "string(ObjectId)",       //封面图片
  "author":           "string",                 //作者
  "isPublished":       bool,                    //是否发布
  "referenceUrl":     "string(Uri)",            //文章引用来源
  "visitCount":        int,                     //访问次数
  "categoryIds":      [ "string(ObjectId)[]" ], //分类ID
  "attachmentIds":    [ "string(ObjectId)[]" ]  //附件
}

Response:

Success
Http Code: 204 NOCONTENT
Response Body:

更新分类API

更新全部字段

PUT api/v1/categories/{id}

参数:

{
  Name:             "string" //分类名称
  Description:      "string" //分类描述
  Priority:         0        //优先级
  ParentCategoryId: "string" //父分类ID
}

返回:

HTTP 204 NOCONTENT

API全局异常处理

  • 数据验证失败后,自动返回400错误,并将异常包装成特定格式
  • NotFound异常自动404处理,并包装成特定格式返回
  • 其他系统异常自动500处理,并包装成特定格式返回
  • 发生异常时,全局记录日志

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.