Skip to main content

配置模块

Project description

Xj-Dictionary Module

字典模块

Part 1. Introduce

介绍

  • 本模块使用M工程化开发文档(MB 311-2022)标准编写

  • 本模块采用MSA设计模式(MB 422-2022)

Install

安装

  • 依赖
# 注:使用pip install django-simple-api会安装不上
pip install git+https://e.coding.net/aber/github/django-simple-api.git@setup.py
  • /settings.py
INSTALLED_APPS = [
    ...,
    "django_simple_api",
    'apps.dictionary.apps.DictionaryConfig',
]
MIDDLEWARE = [
    ...,  
    "django_simple_api.middleware.SimpleApiMiddleware", 
]
  • /main/urls.py
from django.urls import include, re_path
urlpatterns = [
    ...,
    re_path(r'(api/)?dictionary/?', include('apps.dictionary.urls')),
]
urlpatterns += [
    path("docs/", include("django_simple_api.urls"))
]

Part 2. API Document

API 接口文档

Chapter 3. Detail Design

详细设计

3.7 Dictionary 配置类

注:配置不建议从接口中添加,前期设计为从后台添加

1、配置添加(dictionary_configure)

  • 地址

    标准	/api/dictionary_configure/		POST
    简写	/api/config/		POST
    
  • 参数

参数 名词 类型 必须 默认 说明
group 分组 string default -
key string
value string
description 说明 string

2、配置查找 (dictionary_configure)

  • 地址

    /api/dictionary_configure/<group>		GET
    /api/dictionary_configure/<group>/<key>		GET
    
  • 参数

    参数 名词 类型 必须 默认 说明
    group 分组 string default 不传则为默认分组
  • 返回参数说明

    返回参数 名称 类型 说明
    key string
    value string
    description 说明 string
  • 返回示例(/api/)

    {
        "err": 0,
        "msg": "200 OK",
        "data": {
            "logo":
        }
    }
    

2、配置列表 (dictionary_list)

  • 地址

    /api/dictionary_configure_list/		GET
    
  • 参数

    参数 名词 类型 必须 默认 说明
    group 分组 string default 不传则为默认分组
  • 返回参数说明

    返回参数 名称 类型 说明
    key string
    value string
    description 说明 string
  • 返回示例(/api/)

    {
        "err": 0,
        "msg": "200 OK",
        "data": {
            "logo":
        }
    }
    

SQL

CREATE TABLE `dictionary_configure` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `group` varchar(128) NOT NULL,
  `key` varchar(128) NOT NULL,
  `value` longtext NOT NULL,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `dictionary_configure_group_key_d0e0a692_uniq` (`group`,`key`) USING BTREE,
  KEY `dictionary_configure_group_09d9ee65` (`group`) USING BTREE,
  KEY `dictionary_configure_key_52d53a3c` (`key`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xj_dictionary-1.0.8.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

xj_dictionary-1.0.8-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file xj_dictionary-1.0.8.tar.gz.

File metadata

  • Download URL: xj_dictionary-1.0.8.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.5

File hashes

Hashes for xj_dictionary-1.0.8.tar.gz
Algorithm Hash digest
SHA256 6ca560dccf711c0ba2847631fbbe0412d00d6dd3b5aaa9aa228f14b766ddb237
MD5 69688508ce81f4b08e12e6dadd48d966
BLAKE2b-256 6c6c65931777fe7649d0293ea14b60419b93386cf6b27f7bc3775c4d6c948631

See more details on using hashes here.

File details

Details for the file xj_dictionary-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for xj_dictionary-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7edd880ace1f93592a180275f5dcdc5136b664d046f9350383badaf5090148f9
MD5 1e7dcc069aed80b4afc28129b42ed638
BLAKE2b-256 351e22f4f0a1102da880e254e80a524d9652f762d4385857d0a4c171d6cd3332

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page