What should I do if the teacher (non-tutor) wants to be the first author when publishing a paper?
If your thesis is to be used for graduation, you must be the first author. And all of them are your own achievements, so you can't give them away. What did your graduate tutor say? How can your undergraduate graduation design tutor be so unkind to rob your achievements! Even the instructor should be your graduate tutor. This can't be euphemistically expressed. You must insist that you are the first author.