create.sh 889 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. read -p "请输入需要文件的类型(1.controller, 2.filters,3.plugins):" TYPE
  3. case $TYPE in
  4. 1) echo "Create controller"
  5. read -p "请输入controller的名字:" NAME
  6. drogon_ctl create controller -h api::v1::$NAME
  7. mv *$NAME*.h ../source/controllers/include/
  8. mv *$NAME*.cc ../source/controllers/src/
  9. echo "Create $NAME complete!"
  10. ;;
  11. 2) echo "Create filters"
  12. read -p "请输入filters的名字:" NAME
  13. dg_ctl create filter $NAME
  14. mv *.h ../source/filters/include/
  15. mv *.cc ../source/filters/src/
  16. echo "Create $NAME complete!"
  17. ;;
  18. 3) echo "Create plugin"
  19. read -p "请输入plugin的名字:" NAME
  20. dg_ctl create plugin $NAME
  21. mv $NAME.h ../source/plugins/include/$NAME.hpp
  22. mv $NAME.cc ../source/plugins/src/$NAME.cpp
  23. echo "Create $NAME complete!"
  24. ;;
  25. esac