Skip to main content

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;

Release files for xj-dictionary 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xj-dictionary 1.1.0
File Size Uploaded
xj_dictionary-1.1.0.tar.gz 19.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xj-dictionary 1.1.0
File Interpreter ABI Platform
xj_dictionary-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.0 kB

Release files / xj_dictionary-1.1.0.tar.gz

Download URL xj_dictionary-1.1.0.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
038bb3b5dc44d00ec7daaa2d06c8371cf761ce6ac6b0722995adee67c87341bf
BLAKE2b-256 checksum
How to use checksums
6cb37c23f0f1ff44a84c0d4347934672d6a027e7162af5d4c7348ec6489c5704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.6

Release files / xj_dictionary-1.1.0-py3-none-any.whl

Download URL xj_dictionary-1.1.0-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35b9ed21476f6fd349b8a81cc2eeefd82a98e84bfc4bb2e35d4ec737a22b49ca
BLAKE2b-256 checksum
How to use checksums
34b80b4a935aa2fe9d6908f6eabbe0df50981967fea5a61d34b1684f5bb674cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.6

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page