欢迎加入我们~
Agricultural product e-commerce management platform with Vue 3 frontend and Spring Boot backend.
agri-platform/
├── backend/ # Spring Boot (Java 17)
│ └── src/main/java/com/henan/agri/{config,common,user,merchant,product,order,live,category,tag,announcement,statistic,upload}/
├── manage/ # Vue 3 frontend
│ └── src/{components/pages/services/stores/composables/router}/
├── client/ # Documentation
└── workspace/ # Scripts, temp files, misc (project-agnostic)
pnpm install # Install dependencies
pnpm dev # Development server
pnpm build # Production build
pnpm lint # Lint (oxlint + eslint with --fix)
pnpm format # Format with prettier
./mvnw spring-boot:run # Run backend
./mvnw test # Run all tests
./mvnw test -Dtest=AgriApplicationTests # Run single test class
./mvnw test -Dtest=AgriApplicationTests#contextLoads # Run single test method
./mvnw clean package # Build JAR
./mvnw clean package -DskipTests # Build without tests
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\start-backend.ps1" start
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\start-backend.ps1" stop
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\start-backend.ps1" restart
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\start-backend.ps1" status
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\start-backend.ps1" log
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\start-backend.ps1" build
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\get-tokens.ps1"
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\get-tokens.ps1" -listUsers
Tokens saved to .[username].token files. Use token in curl:
TOKEN=$(cat .admin.token)
curl -H "Authorization: Bearer $TOKEN" http://localhost:8080/api/user/info
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\test-api.ps1" -endpoint merchant/list -user admin
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\test-api.ps1" -endpoint user/info -user admin
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\test-api.ps1" -endpoint merchant/1 -method PUT -body '{"name":"新名称"}' -user admin
powershell -File "C:\Users\Tribbt\Desktop\Ming\workspace\test-api.ps1" -help
jdbc:mysql://stivenkuper-mysql.mysql.database.azure.com/agri-platform
stivenkuper
Stivenkuper123
backend/sql/init.sql
/api
http://localhost:8080/api
| Role | Username | Password |
|---|---|---|
| ADMIN | admin | admin123 |
| MERCHANT | merchant | merchant123 |
<script setup> with Composition API; PascalCase filenamesget/post/put/del from ./api.js
rgb(99 102 241)
import { ref, computed } from 'vue'
import { Loader2 } from 'lucide-vue-next'
import { useToast } from '../composables/useToast'
import * as productApi from '../services/productApi'
controller/service/mapper/domain/dto/vo/repository/
{Name}Entity, {Name}DTO, {Name}VO, {Name}Controller, {Name}Service, {Name}Mapper
@RestController, @RequiredArgsConstructor for constructor injectionResult<T> wrapper (Result.success() / Result.error())BusinessException for business errors; global handler catches themisDeleted (0=active, 1=deleted); queries filter isDeleted = 0
@Data
@TableName("product")
public class ProductEntity {
private Long id;
@TableField("is_deleted")
private Integer isDeleted;
}
token key)Authorization: Bearer {token}, userId: {id}
ADMIN, MERCHANT
com.henan.agri.{module}
@Data, @TableName), Mapper (extends BaseMapper), DTO (validation), VO@Service, @RequiredArgsConstructor) with LambdaQueryWrapper queriesResult<T> responsessrc/pages/
src/router/index.js
src/services/
src/components/ui/
pnpm only (no npm)workspace/
/api, all endpoints include this prefix| Issue | Cause | Solution |
|---|---|---|
| Login returns 401 | JwtAuthFilter whitelist missing /api prefix |
Check JwtAuthFilter.java isWhiteListPath method |
| curl JSON parse error | PowerShell JSON handling | Use Invoke-RestMethod or ConvertTo-Json
|
| get-tokens.ps1 fails | Backend not running | Check .\start-backend.ps1 status, verify whitelist |
| API returns 500 | DB connection or logic error | Check logs: Get-Content workspace\backend.log -Tail 50
|
pnpm lint (frontend)./mvnw compile (backend)./mvnw test (backend)