DjangoAdmin DevandClaude 0cfaf8c894 refactor: P4b position 标杆模块服务层改造 + 单元测试
【服务层新范式】system/position 作为标杆:
- service 函数改「入参数据/出参数据」:get_position_page(params)->dict、
  add_position(data)/update_position(data)/update_position_status(data)->None、
  delete_positions(ids)->int
- 业务失败 raise BizError(不再 return R.failed),由全局处理器转 R.failed
- get_info 委托 PositionRepository(新增 repository.py,继承 BaseRepository)
- router 负责取参(query args / parse_request_body)与 R 包装

【单元测试】tests/unit/test_modules/test_position_service.py:
- 纯函数(_build_page_data)、BizError 契约(空数据/空ID/无效ID)、
  mock 批量删除(ID 解析验证)——无需数据库即可测试
- conftest flask_app fixture 增加 SECRET_KEY + 关闭 CSRF

【验收】12 passed(5 响应 + 7 position);应用启动;flake8 零告警;
position 路由 401 拦截正常。服务层测试化范式验证可行

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 14:42:03 +08:00
2026-08-07 12:14:51 +08:00
2026-08-07 12:14:51 +08:00
2026-08-07 12:14:51 +08:00

DjangoAdmin_Flask_EleVue

Description

一款 Python 语言基于Flask、Vue2.x、ElementUI、MySQL等框架精心打造的一款模块化、高性能、企业级的敏捷开发框架,本着简化开发、提升开发效率的初衷触发,框架自研了一套个性化的组件,实现了可插拔的组件式开发方式:单图上传、多图上传、下拉选择、开关按钮、单选按钮、多选按钮、图片裁剪等等一系列个性化、轻量级的组件,是一款真正意义上实现组件化开发的敏捷开发框架。

Software Architecture

Software architecture description

Installation

  1. xxxx
  2. xxxx
  3. xxxx

Instructions

  1. xxxx
  2. xxxx
  3. xxxx

Contribution

  1. Fork the repository
  2. Create Feat_xxx branch
  3. Commit your code
  4. Create Pull Request

Gitee Feature

  1. You can use Readme_XXX.md to support different languages, such as Readme_en.md, Readme_zh.md
  2. Gitee blog blog.gitee.com
  3. Explore open source project https://gitee.com/explore
  4. The most valuable open source project GVP
  5. The manual of Gitee https://gitee.com/help
  6. The most popular members https://gitee.com/gitee-stars/
S
Description
No description provided
Readme Apache-2.0
24 MiB
Languages
Python 47.8%
Vue 24.9%
CSS 11.4%
TypeScript 11%
Go Template 2.6%
Other 2.1%